diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 07:08:12 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 07:08:12 +0000 |
commit | 03af450acf491233fb11ba3bf69294aaf0228c6b (patch) | |
tree | 793bd15fcce300af75aac7322b9fc08a27ee2853 /base/stl_util-inl.h | |
parent | 834bbfa6f25159c44c6160331cbcdaf6e57d5215 (diff) | |
download | chromium_src-03af450acf491233fb11ba3bf69294aaf0228c6b.zip chromium_src-03af450acf491233fb11ba3bf69294aaf0228c6b.tar.gz chromium_src-03af450acf491233fb11ba3bf69294aaf0228c6b.tar.bz2 |
Temporarily landing my ClientSocketPool refactor. Will revert right after.
Review URL: http://codereview.chromium.org/113759
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16731 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/stl_util-inl.h')
-rw-r--r-- | base/stl_util-inl.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/base/stl_util-inl.h b/base/stl_util-inl.h index 54b7b29..70fa69e 100644 --- a/base/stl_util-inl.h +++ b/base/stl_util-inl.h @@ -447,4 +447,11 @@ std::vector<T> SetToVector(const std::set<T>& values) { return result; } +// Test to see if a set, map, hash_set or hash_map contains a particular key. +// Returns true if the key is in the collection. +template <typename Collection, typename Key> +bool ContainsKey(const Collection& collection, const Key& key) { + return collection.find(key) != collection.end(); +} + #endif // BASE_STL_UTIL_INL_H_ |