From 79a2088a13460f832c450fda682ef5c6e92405c6 Mon Sep 17 00:00:00 2001 From: ForLoveOfCats Date: Wed, 20 Apr 2022 15:33:41 -0400 Subject: [PATCH] AK: Make `Vector::contains_slow` templated This allows for calling this function with any argument type for which the appropriate traits and operators have been implemented so it can be compared to the Vector's item type --- AK/Vector.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AK/Vector.h b/AK/Vector.h index 88c0ba74c23..a68628282e1 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -203,7 +203,8 @@ public: return TypedTransfer::compare(data(), other.data(), size()); } - bool contains_slow(VisibleType const& value) const + template + bool contains_slow(V const& value) const { for (size_t i = 0; i < size(); ++i) { if (Traits::equals(at(i), value))