shell: windows: make EnvMap case-insensitive (#9704)

* shell: windows: make EnvMap case-insensitive

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Meghan Denny
2024-03-29 12:21:09 -07:00
committed by GitHub
parent 40f61ebb91
commit fb8a299765

View File

@@ -509,11 +509,17 @@ pub const EnvMap = struct {
const MapType = std.ArrayHashMap(EnvStr, EnvStr, struct {
pub fn hash(self: @This(), s: EnvStr) u32 {
_ = self;
if (bun.Environment.isWindows) {
return bun.CaseInsensitiveASCIIStringContext.hash(undefined, s.slice());
}
return std.array_hash_map.hashString(s.slice());
}
pub fn eql(self: @This(), a: EnvStr, b: EnvStr, b_index: usize) bool {
_ = self;
_ = b_index;
if (bun.Environment.isWindows) {
return bun.CaseInsensitiveASCIIStringContext.eql(undefined, a.slice(), b.slice(), undefined);
}
return std.array_hash_map.eqlString(a.slice(), b.slice());
}
}, true);