Skip to content

Commit 1919c6e

Browse files
committed
perf(css): note a rule for merging only when merging is on
The bookkeeping ran whether or not the option asked for it: Bootstrap paid 1280 calls and 1172 block slices with it off, which is 30.8 ms against 27.9 once gated.
1 parent 2d5851b commit 1919c6e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎lib/css/syntax.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5551,7 +5551,8 @@ const _takeTopLevel = (node, writer, offset, line, column) => {
55515551
}
55525552
}
55535553
if (held !== null) {
5554-
_noteDistantRule(_emitHeld(writer, held), held.entry);
5554+
const taken = _emitHeld(writer, held);
5555+
if (_mergingDistantRules) _noteDistantRule(taken, held.entry);
55555556
}
55565557
if (_mergingDistantRules && _mergeIntoDistantRule(writer, entry)) {
55575558
// Its selectors went into a rule already out, so it prints nothing itself

0 commit comments

Comments
 (0)