mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-06 19:22:53 +00:00
LibWeb: Use IterationDecision
in single level Node iteration methods
`Node::for_each_child()` and `Node::for_each_child_of_type()` callbacks now return an `IterationDecision`, which allows us to break early if required.
This commit is contained in:
parent
b5bed37074
commit
c57d395a48
Notes:
sideshowbarker
2024-07-17 02:35:27 +09:00
Author: https://github.com/tcl3
Commit: c57d395a48
Pull-request: https://github.com/SerenityOS/serenity/pull/24207
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/shannonbooth ✅
25 changed files with 81 additions and 27 deletions
|
@ -864,6 +864,7 @@ static void update_the_source_set(DOM::Element& element)
|
|||
elements.clear();
|
||||
element.parent()->for_each_child_of_type<DOM::Element>([&](auto& child) {
|
||||
elements.append(&child);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue