RESOLVED FIXED Bug 224248
Wasted vector capacity under RuleFeatureSet::collectFeatures()
https://bugs.webkit.org/show_bug.cgi?id=224248
Summary Wasted vector capacity under RuleFeatureSet::collectFeatures()
Simon Fraser (smfr)
Reported 2021-04-06 15:09:03 PDT
Wasted vector capacity under RuleFeatureSet::collectFeatures()
Attachments
Patch (2.41 KB, patch)
2021-04-06 15:10 PDT, Simon Fraser (smfr)
hi: review+
Simon Fraser (smfr)
Comment 1 2021-04-06 15:10:36 PDT
Devin Rousso
Comment 2 2021-04-07 09:59:28 PDT
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?
Antti Koivisto
Comment 3 2021-04-07 10:01:37 PDT
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.
Simon Fraser (smfr)
Comment 4 2021-04-07 15:47:47 PDT
Radar WebKit Bug Importer
Comment 5 2021-04-07 15:48:52 PDT
Note You need to log in before you can comment on or make changes to this bug.