From e267b9073df1d0ce119ee53c0487fe76acb2be37 Mon Sep 17 00:00:00 2001 From: Robert Kieffer Date: Wed, 11 Oct 2023 15:48:03 -0700 Subject: [PATCH] fix: revert "perf: remove superfluous call to toLowerCase (#677)" (#738) --- src/stringify.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stringify.js b/src/stringify.js index 3d15e61a..8e80d2d1 100644 --- a/src/stringify.js +++ b/src/stringify.js @@ -13,6 +13,9 @@ for (let i = 0; i < 256; ++i) { export function unsafeStringify(arr, offset = 0) { // Note: Be careful editing this code! It's been tuned for performance // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + // + // Note to future-self: No, you can't remove the `toLowerCase()` call. + // REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351 return ( byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + @@ -34,7 +37,7 @@ export function unsafeStringify(arr, offset = 0) { byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]] - ); + ).toLowerCase(); } function stringify(arr, offset = 0) {