diff options
author | 2023-02-25 18:22:29 -0800 | |
---|---|---|
committer | 2023-02-25 18:23:01 -0800 | |
commit | 693be3d1c2fe63cb5961a0023ad4c301209495bc (patch) | |
tree | c56159b91e01438a416b5b10dc114f9f51fef61a /src/bun.js/api/bun.zig | |
parent | 8ba65a4f0bbd38b5c6a677d93d1fa13d0042bb35 (diff) | |
download | bun-693be3d1c2fe63cb5961a0023ad4c301209495bc.tar.gz bun-693be3d1c2fe63cb5961a0023ad4c301209495bc.tar.zst bun-693be3d1c2fe63cb5961a0023ad4c301209495bc.zip |
Faster `eqlCaseInsensitiveASCII`
Diffstat (limited to 'src/bun.js/api/bun.zig')
-rw-r--r-- | src/bun.js/api/bun.zig | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/bun.js/api/bun.zig b/src/bun.js/api/bun.zig index 5e92a470d..1c991eece 100644 --- a/src/bun.js/api/bun.zig +++ b/src/bun.js/api/bun.zig @@ -1541,13 +1541,7 @@ pub const Crypto = struct { } pub fn byNameAndEngine(engine: *BoringSSL.ENGINE, name: []const u8) ?EVP { - - // none of the names are longer than 255 - var buf: [256]u8 = undefined; - const len = @min(name.len, buf.len - 1); - _ = strings.copyLowercase(name, &buf); - - if (Algorithm.map.get(buf[0..len])) |algorithm| { + if (Algorithm.map.getWithEql(name, strings.eqlCaseInsensitiveASCIIIgnoreLength)) |algorithm| { if (algorithm == .blake2b256) { return EVP.init(algorithm, BoringSSL.EVP_blake2b256(), engine); } |