| Summary: | Wasted vector capacity under RuleFeatureSet::collectFeatures() | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> | ||||
| Component: | CSS | Assignee: | Simon Fraser (smfr) <simon.fraser> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | hi, koivisto, simon.fraser, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Simon Fraser (smfr)
2021-04-06 15:09:03 PDT
Created attachment 425330 [details]
Patch
Comment on attachment 425330 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=425330&action=review r=me > Source/WebCore/style/StyleScopeRuleSets.cpp:253 > + if (matchElementArray[i]) { NIT: you could save this as `auto* matchElementItem = matchElementArray[i]` to avoid repeated access > Source/WebCore/style/StyleScopeRuleSets.cpp:255 > + invalidationRuleSets->uncheckedAppend({ static_cast<MatchElement>(i), *matchElementArray[i], WTFMove(invalidationSelectorArray[i]) }); NIT: Could this be `matchElementItem.releaseNonNull()` since it's created above? Comment on attachment 425330 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=425330&action=review > Source/WebCore/style/StyleScopeRuleSets.cpp:245 > + unsigned ruleSetCount = 0; > for (unsigned i = 0; i < matchElementArray.size(); ++i) { > if (matchElementArray[i]) This loop could now use range-for. |