pub const MapContext = struct string_bytes: []const u8pub fn hash(self: MapContext, a: File) u32pub fn eql(self: MapContext, a: File, b: File, b_index: usize) bool90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105 pub const MapContext = struct {
string_bytes: []const u8,
pub fn hash(self: MapContext, a: File) u32 {
const a_basename = span(self.string_bytes[@backingInt(a.basename)..]);
return @truncate(Hash.hash(a.directory_index, a_basename));
}
pub fn eql(self: MapContext, a: File, b: File, b_index: usize) bool {
_ = b_index;
if (a.directory_index != b.directory_index) return false;
const a_basename = span(self.string_bytes[@backingInt(a.basename)..]);
const b_basename = span(self.string_bytes[@backingInt(b.basename)..]);
return std.mem.eql(u8, a_basename, b_basename);
}
}