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

Side by Side Diff: base/stl_util-inl.h

Issue 113517: Revert "Revert "Revert "Add connected socket function to ClientSocketPool and ClientSocketHandle.""" (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 unified diff | Download patch
« no previous file with comments | « no previous file | net/base/client_socket_handle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // STL utility functions. Usually, these replace built-in, but slow(!), 5 // STL utility functions. Usually, these replace built-in, but slow(!),
6 // STL functions with more efficient versions. 6 // STL functions with more efficient versions.
7 7
8 #ifndef BASE_STL_UTIL_INL_H_ 8 #ifndef BASE_STL_UTIL_INL_H_
9 #define BASE_STL_UTIL_INL_H_ 9 #define BASE_STL_UTIL_INL_H_
10 10
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 440
441 // Translates a set into a vector. 441 // Translates a set into a vector.
442 template<typename T> 442 template<typename T>
443 std::vector<T> SetToVector(const std::set<T>& values) { 443 std::vector<T> SetToVector(const std::set<T>& values) {
444 std::vector<T> result; 444 std::vector<T> result;
445 result.reserve(values.size()); 445 result.reserve(values.size());
446 result.insert(result.begin(), values.begin(), values.end()); 446 result.insert(result.begin(), values.begin(), values.end());
447 return result; 447 return result;
448 } 448 }
449 449
450 // Test to see if a set, map, hash_set or hash_map contains a particular key.
451 // Returns true if the key is in the collection.
452 template <typename Collection, typename Key>
453 bool ContainsKey(const Collection& collection, const Key& key) {
454 return collection.find(key) != collection.end();
455 }
456
457 #endif // BASE_STL_UTIL_INL_H_ 450 #endif // BASE_STL_UTIL_INL_H_
OLDNEW
« 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