Skip to content

dom: reduce traversal in CompareDocumentPosition#42260

Merged
jdm merged 1 commit intoservo:mainfrom
webbeef:less-traversal
Jan 31, 2026
Merged

dom: reduce traversal in CompareDocumentPosition#42260
jdm merged 1 commit intoservo:mainfrom
webbeef:less-traversal

Conversation

@webbeef
Copy link
Copy Markdown
Contributor

@webbeef webbeef commented Jan 30, 2026

We can avoid doing 2 traversals and stop at the first matching child we find. This ensures we are never doing the longest iteration.

Testing: covered by WPT

We can avoid doing 2 traversals and stop at the first matching child we find.
This ensures we are never doing the longest iteration.

Signed-off-by: webbeef <me@webbeef.org>
@webbeef webbeef requested a review from gterzian as a code owner January 30, 2026 19:02
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 30, 2026
Copy link
Copy Markdown
Member

@jdm jdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart!

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Jan 30, 2026
@jdm jdm added this pull request to the merge queue Jan 30, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jan 30, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 30, 2026
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jan 30, 2026
@jdm jdm added this pull request to the merge queue Jan 30, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jan 30, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 31, 2026
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jan 31, 2026
@jdm jdm added this pull request to the merge queue Jan 31, 2026
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jan 31, 2026
Merged via the queue into servo:main with commit 58b56ed Jan 31, 2026
41 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants