From 5795f66d2eebccbc8e04b80ebaf163f636479f9e Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Tue, 12 Feb 2019 22:59:12 +0000 Subject: Codechange: Replaced SmallVector::Contains() with std::find() pattern --- src/core/smallvec_type.hpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src/core') diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 5225d13da..9df015ad8 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -114,17 +114,6 @@ public: return it == std::vector::end() ? -1 : it - std::vector::begin(); } - /** - * Tests whether a item is present in the vector. - * The '!=' operator of T is used for comparison. - * @param item Item to test for - * @return true iff the item is present - */ - inline bool Contains(const T &item) const - { - return std::find(std::vector::begin(), std::vector::end(), item) != std::vector::end(); - } - /** * Removes given item from this vector * @param item item to remove @@ -145,7 +134,7 @@ public: */ inline bool Include(const T &item) { - bool is_member = this->Contains(item); + bool is_member = std::find(std::vector::begin(), std::vector::end(), item) != std::vector::end(); if (!is_member) *this->Append() = item; return is_member; } -- cgit v1.2.3-54-g00ecf