We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8561cc6 commit c47702cCopy full SHA for c47702c
lib/bytesToUuid.js
@@ -10,14 +10,15 @@ for (var i = 0; i < 256; ++i) {
10
function bytesToUuid(buf, offset) {
11
var i = offset || 0;
12
var bth = byteToHex;
13
- return bth[buf[i++]] + bth[buf[i++]] +
14
- bth[buf[i++]] + bth[buf[i++]] + '-' +
15
16
17
18
- bth[buf[i++]] + bth[buf[i++]] +
19
20
- bth[buf[i++]] + bth[buf[i++]];
+ // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
+ return ([bth[buf[i++]], bth[buf[i++]],
+ bth[buf[i++]], bth[buf[i++]], '-',
+ bth[buf[i++]], bth[buf[i++]],
21
+ bth[buf[i++]], bth[buf[i++]]]).join('');
22
}
23
24
module.exports = bytesToUuid;
0 commit comments