Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(945)

Unified Diff: base/stl_util-inl.h

Issue 118219: Reland my ClientSocketPool refactor again... (Closed)
Patch Set: Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/client_socket_handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/stl_util-inl.h
diff --git a/base/stl_util-inl.h b/base/stl_util-inl.h
index 54b7b296c0ad2adc76bb9261535b95bf6d4fd9f2..70fa69e57d7bb415799ade34de914a7214f945a4 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_
« no previous file with comments | « no previous file | net/base/client_socket_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698