From 03af450acf491233fb11ba3bf69294aaf0228c6b Mon Sep 17 00:00:00 2001 From: "willchan@chromium.org" Date: Fri, 22 May 2009 07:08:12 +0000 Subject: 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 --- base/stl_util-inl.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'base/stl_util-inl.h') 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 SetToVector(const std::set& 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 +bool ContainsKey(const Collection& collection, const Key& key) { + return collection.find(key) != collection.end(); +} + #endif // BASE_STL_UTIL_INL_H_ -- cgit v1.1