pub fn defaultEql(a: []const u8, b: []const u8) bool a: []const u8b: []const u813
14
15
16
17
18
19pub fn defaultEql(a: []const u8, b: []const u8) bool {
if (a.ptr == b.ptr) return true;
for (a, b) |a_elem, b_elem| {
if (a_elem != b_elem) return false;
}
return true;
}
Like
std.mem.eql, but takes advantage of the fact that the lengths ofaandbare known to be equal.