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