Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revert "perf: remove superfluous call to toLowerCase (#677)" #738

Merged
merged 2 commits into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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