mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibWeb: Make recompute_selection_states()
go faster
...by avoiding `is_before()` call on every loop iteration in step 5. This change makes switching channels on Discord go a lot faster.
This commit is contained in:
parent
c63e77142a
commit
bc8870d019
Notes:
github-actions[bot]
2025-07-03 11:49:32 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: bc8870d019
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5280
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/Psychpsyo
Reviewed-by: https://github.com/gmta ✅
1 changed files with 1 additions and 1 deletions
|
@ -374,7 +374,7 @@ void ViewportPaintable::recompute_selection_states(DOM::Range& range)
|
|||
}
|
||||
|
||||
// 5. Mark the nodes between start node and end node (in tree order) as Full.
|
||||
for (auto* node = start_container->next_in_pre_order(); node && (node->is_before(end_container) || node->is_descendant_of(end_container)); node = node->next_in_pre_order()) {
|
||||
for (auto* node = start_container->next_in_pre_order(); node && node != end_container; node = node->next_in_pre_order()) {
|
||||
if (node->is_inert())
|
||||
continue;
|
||||
if (auto* paintable = node->paintable())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue