Restructure uleb128
This commit is contained in:
12
asm.js
12
asm.js
@@ -1156,13 +1156,15 @@ export class Assembler {
|
|||||||
|
|
||||||
uleb128(x) {
|
uleb128(x) {
|
||||||
const bytes = [];
|
const bytes = [];
|
||||||
do {
|
while (true) {
|
||||||
const b = x & 0x7f;
|
const b = x & 0x7f;
|
||||||
x >>= 7;
|
x >>= 7;
|
||||||
if (x != 0)
|
if (x == 0) {
|
||||||
b |= 0x80;
|
bytes.push(b);
|
||||||
bytes.push(b);
|
return bytes;
|
||||||
} while (x != 0);
|
}
|
||||||
|
bytes.push(b | 0x80);
|
||||||
|
}
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user