mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
perf(encoding): fix loop times in encodeHex()
(#5344)
This commit is contained in:
parent
ab0dd78b17
commit
1a637a71a9
@ -71,7 +71,7 @@ export function encodeHex(src: string | Uint8Array | ArrayBuffer): string {
|
||||
const u8 = validateBinaryLike(src);
|
||||
|
||||
const dst = new Uint8Array(u8.length * 2);
|
||||
for (let i = 0; i < dst.length; i++) {
|
||||
for (let i = 0; i < u8.length; i++) {
|
||||
const v = u8[i]!;
|
||||
dst[i * 2] = hexTable[v >> 4]!;
|
||||
dst[i * 2 + 1] = hexTable[v & 0x0f]!;
|
||||
|
Loading…
Reference in New Issue
Block a user