From d3d3b25e1cf1763661a241e512745dd9b105f905 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 6 Oct 2020 18:38:18 +0200 Subject: [PATCH] AK: Make Vector::remove_first_matching() signal if anything was removed --- AK/Vector.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AK/Vector.h b/AK/Vector.h index 94804368a9..01ed92ee24 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -339,14 +339,15 @@ public: } template - 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