AK: Make Vector::remove_first_matching() signal if anything was removed

This commit is contained in:
Andreas Kling 2020-10-06 18:38:18 +02:00
parent 8baacda03d
commit d3d3b25e1c
Notes: sideshowbarker 2024-07-19 02:00:21 +09:00

View file

@ -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>