Bug 261209
| Summary: | Avoid linear search in ScrollingStateTree::insertNode() when node is already present at desired index | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> |
| Component: | Layout and Rendering | Assignee: | Chris Dumez <cdumez> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bfulgham, simon.fraser, webkit-bug-importer, zalan |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Chris Dumez
Avoid linear search in ScrollingStateTree::insertNode() when node is already present at desired index.
We used to do a linear search to find the index of `child` and then compare it with `childIndex`. Instead, we now lookup the node at `childIndex` (which is cheap) and compare it to `child`. This allows us to drop some now unused code as well.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Chris Dumez
Pull request: https://github.com/WebKit/WebKit/pull/17487
EWS
Committed 267698@main (78a45ba1d608): <https://commits.webkit.org/267698@main>
Reviewed commits have been landed. Closing PR #17487 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/115078904>