Skip to content

Commit 6a89a8f

Browse files
Link-the-elfMike
andauthored
chore: optimize get_amount_class_specificity_increased (#9853)
* Optimaze * pnpm format --------- Co-authored-by: Mike <[email protected]>
1 parent acf7310 commit 6a89a8f

File tree

1 file changed

+1
-7
lines changed
  • packages/svelte/src/compiler/phases/2-analyze/css

1 file changed

+1
-7
lines changed

packages/svelte/src/compiler/phases/2-analyze/css/Selector.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,7 @@ export default class Selector {
193193
}
194194

195195
get_amount_class_specificity_increased() {
196-
let count = 0;
197-
for (const block of this.blocks) {
198-
if (block.should_encapsulate) {
199-
count++;
200-
}
201-
}
202-
return count;
196+
return this.blocks.filter((block) => block.should_encapsulate).length;
203197
}
204198
}
205199

0 commit comments

Comments
 (0)