struct MapContext [src]
Fields
string_bytes: []const u8
Members
Source
pub const MapContext = struct {
string_bytes: []const u8,
pub fn hash(self: MapContext, a: File) u32 {
const a_basename = span(self.string_bytes[@intFromEnum(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[@intFromEnum(a.basename)..]);
const b_basename = span(self.string_bytes[@intFromEnum(b.basename)..]);
return std.mem.eql(u8, a_basename, b_basename);
}
}