mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 11:36:10 +00:00
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
This commit is contained in:
parent
a7fe3183f5
commit
79a2088a13
Notes:
sideshowbarker
2024-07-17 11:38:32 +09:00
Author: https://github.com/ForLoveOfCats Commit: https://github.com/SerenityOS/serenity/commit/79a2088a13 Pull-request: https://github.com/SerenityOS/serenity/pull/13171 Reviewed-by: https://github.com/alimpfard ✅ Reviewed-by: https://github.com/linusg
1 changed files with 2 additions and 1 deletions
|
@ -203,7 +203,8 @@ public:
|
|||
return TypedTransfer<StorageType>::compare(data(), other.data(), size());
|
||||
}
|
||||
|
||||
bool contains_slow(VisibleType const& value) const
|
||||
template<typename V>
|
||||
bool contains_slow(V const& value) const
|
||||
{
|
||||
for (size_t i = 0; i < size(); ++i) {
|
||||
if (Traits<VisibleType>::equals(at(i), value))
|
||||
|
|
Loading…
Add table
Reference in a new issue