From 138cc10361b7dca0fa13efb59f24394797e41219 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 18 Apr 2017 09:39:24 -0700 Subject: Take ContainsValue() change from base stl_util.h Allows us to apply this same predicate onto ordinary arrays. Change-Id: I917be09ed5e55167657c9af97f45f2ea2dbc6ab4 Reviewed-on: https://pdfium-review.googlesource.com/4270 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- third_party/base/stl_util.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/third_party/base/stl_util.h b/third_party/base/stl_util.h index 9c71530c12..84137f4d42 100644 --- a/third_party/base/stl_util.h +++ b/third_party/base/stl_util.h @@ -6,6 +6,7 @@ #define PDFIUM_THIRD_PARTY_BASE_STL_UTIL_H_ #include +#include #include #include @@ -25,8 +26,8 @@ bool ContainsKey(const Collection& collection, const Key& key) { // Returns true if the value is in the collection. template bool ContainsValue(const Collection& collection, const Value& value) { - return std::find(collection.begin(), collection.end(), value) != - collection.end(); + return std::find(std::begin(collection), std::end(collection), value) != + std::end(collection); } // Means of generating a key for searching STL collections of std::unique_ptr -- cgit v1.2.3