Closed Bug 1385521 Opened 2 years ago Closed 2 years ago
Range::Get Common Ancestor() is expensive for the obvious case
For text controls, the start and end of the container is the same often times, but because the nsContentUtils API doesn't get inlines, nsRange::GetCommonAncestor() shows up in profiles of bug 1346723. GetCommonAncestorInternal() is a template, so we already have two copies of this check: https://searchfox.org/mozilla-central/rev/09c065976fd4f18d4ad764d7cb4bbc684bf56714/dom/base/nsContentUtils.cpp#2709. So we may as well inline them in the header to get them to the caller side instead so that we make the common case for these situations faster.
Attachment #8891597 - Flags: review?(amarchesini) → review+
Pushed by email@example.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/76abbe45dd0a Inline the check for common argument in the callers of GetCommonAncestorInternal(); r=baku
You need to log in before you can comment on or make changes to this bug.