diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-04-18 09:39:24 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-20 20:14:27 +0000 |
commit | 138cc10361b7dca0fa13efb59f24394797e41219 (patch) | |
tree | 1ba5ebf6c8bebba3607f805ec7c963bf4865e403 | |
parent | ddfc3dcce42ad1dc805f29102f7d056a5809d489 (diff) | |
download | pdfium-138cc10361b7dca0fa13efb59f24394797e41219.tar.xz |
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 <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
-rw-r--r-- | third_party/base/stl_util.h | 5 |
1 files 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 <algorithm> +#include <iterator> #include <memory> #include <set> @@ -25,8 +26,8 @@ bool ContainsKey(const Collection& collection, const Key& key) { // Returns true if the value is in the collection. template <typename Collection, typename Value> 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 |