pub fn orderIgnoreCase(lhs: []const u8, rhs: []const u8) std.math.Order lhs: []const u8rhs: []const u8443
444
445
446
447
448
449
450
451
452
453
454
455
456pub fn orderIgnoreCase(lhs: []const u8, rhs: []const u8) std.math.Order {
if (lhs.ptr != rhs.ptr) {
const n = @min(lhs.len, rhs.len);
var i: usize = 0;
while (i < n) : (i += 1) {
switch (std.math.order(toLower(lhs[i]), toLower(rhs[i]))) {
.eq => continue,
.lt => return .lt,
.gt => return .gt,
}
}
}
return std.math.order(lhs.len, rhs.len);
}
Returns the lexicographical order of two slices. O(n).