| ... | @@ -597,9 +597,8 @@ pub fn sortUnstableContext(a: usize, b: usize, context: anytype) void { | ... | @@ -597,9 +597,8 @@ pub fn sortUnstableContext(a: usize, b: usize, context: anytype) void { |
| 597 | /// Compares two slices of numbers lexicographically. O(n). | 597 | /// Compares two slices of numbers lexicographically. O(n). |
| 598 | pub fn order(comptime T: type, lhs: []const T, rhs: []const T) math.Order { | 598 | pub fn order(comptime T: type, lhs: []const T, rhs: []const T) math.Order { |
| 599 | const n = @min(lhs.len, rhs.len); | 599 | const n = @min(lhs.len, rhs.len); |
| 600 | var i: usize = 0; | 600 | for (lhs[0..n], rhs[0..n]) |lhs_elem, rhs_elem| { |
| 601 | while (i < n) : (i += 1) { | 601 | switch (math.order(lhs_elem, rhs_elem)) { |
| 602 | switch (math.order(lhs[i], rhs[i])) { | | |
| 603 | .eq => continue, | 602 | .eq => continue, |
| 604 | .lt => return .lt, | 603 | .lt => return .lt, |
| 605 | .gt => return .gt, | 604 | .gt => return .gt, |