mirror of https://github.com/status-im/metro.git
No compound assignement operators
Summary: Addresses a performance regression introduced by automatic linting: Compound assignment operators are much slower than keeping assignment separate on `let` bindings in certain versions of v8. This reverts the relevant changes and configures eslint to *disallow* these operators explicitly in `metro-source-map`. Reviewed By: mjesun Differential Revision: D6520485 fbshipit-source-id: 16f35f5cd691ce6b1924480cbc30fbaa1275f730
This commit is contained in:
parent
c5e83dd86a
commit
ae5ebc8078
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"rules": {
|
||||
"operator-assignment": ["error", "never"]
|
||||
},
|
||||
"env": {
|
||||
"node": true
|
||||
}
|
||||
}
|
|
@ -167,11 +167,11 @@ function encode(value: number, buffer: Buffer, position: number): number {
|
|||
let digit;
|
||||
do {
|
||||
digit = vlq & VLQ_BASE_MASK;
|
||||
vlq >>>= VLQ_BASE_SHIFT;
|
||||
vlq = vlq >>> VLQ_BASE_SHIFT;
|
||||
if (vlq > 0) {
|
||||
// There are still more digits in this value, so we must make sure the
|
||||
// continuation bit is marked.
|
||||
digit |= VLQ_CONTINUATION_BIT;
|
||||
digit = digit | VLQ_CONTINUATION_BIT;
|
||||
}
|
||||
buffer[position++] = CHAR_MAP[digit];
|
||||
} while (vlq > 0);
|
||||
|
|
|
@ -56,7 +56,7 @@ function fromRawMappings(
|
|||
);
|
||||
}
|
||||
|
||||
carryOver += countLines(code);
|
||||
carryOver = carryOver + countLines(code);
|
||||
}
|
||||
|
||||
return generator;
|
||||
|
|
Loading…
Reference in New Issue