util: use regular loop constructs for u64 writes.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
parent
2aabef9a6d
commit
0b188640ec
@ -188,6 +188,10 @@ utils.writeU64 = function writeU64(dst, num, off) {
|
||||
dst[off++] = ch;
|
||||
});
|
||||
|
||||
var i = num.length;
|
||||
while (i--)
|
||||
dst[off++] = num[i];
|
||||
|
||||
return 8;
|
||||
};
|
||||
|
||||
@ -217,9 +221,8 @@ utils.writeU64BE = function writeU64BE(dst, num, off) {
|
||||
while (num.length < 8)
|
||||
num.unshift(0);
|
||||
|
||||
num.forEach(function(ch) {
|
||||
dst[off++] = ch;
|
||||
});
|
||||
for (var i = 0; i < num.length; i++)
|
||||
dst[off++] = num[i];
|
||||
|
||||
return 8;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user