mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user