Skip to content

Commit

Permalink
fix: revert "perf: remove superfluous call to toLowerCase (#677)" (#738)
Browse files Browse the repository at this point in the history
  • Loading branch information
broofa committed Jun 8, 2024
1 parent b3f142f commit ddf309d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/stringify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]] +
Expand All @@ -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) {
Expand Down

0 comments on commit ddf309d

Please sign in to comment.