WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
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+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Simon Fraser (smfr)
Comment 1
2021-04-06 15:10:36 PDT
Created
attachment 425330
[details]
Patch
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
https://trac.webkit.org/changeset/275637/webkit
Radar WebKit Bug Importer
Comment 5
2021-04-07 15:48:52 PDT
<
rdar://problem/76369495
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug