mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
AK: Make Vector::remove_first_matching() signal if anything was removed
This commit is contained in:
parent
8baacda03d
commit
d3d3b25e1c
Notes:
sideshowbarker
2024-07-19 02:00:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d3d3b25e1cf
1 changed files with 3 additions and 2 deletions
|
@ -339,14 +339,15 @@ public:
|
|||
}
|
||||
|
||||
template<typename Callback>
|
||||
void remove_first_matching(Callback callback)
|
||||
bool remove_first_matching(Callback callback)
|
||||
{
|
||||
for (size_t i = 0; i < size(); ++i) {
|
||||
if (callback(at(i))) {
|
||||
remove(i);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template<typename Callback>
|
||||
|
|
Loading…
Reference in a new issue