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

Unified Diff: net/extras/sqlite/sqlite_channel_id_store.cc

Issue 2943703002: Use ContainsValue() instead of std::find() in net/ (Closed)
Patch Set: Created 3 years, 6 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 | « net/dns/host_resolver_impl_unittest.cc ('k') | net/http/http_security_headers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/extras/sqlite/sqlite_channel_id_store.cc
diff --git a/net/extras/sqlite/sqlite_channel_id_store.cc b/net/extras/sqlite/sqlite_channel_id_store.cc
index 70ca8d979871acca79ac4c7e2b835e28da72bdb4..7b36b9c90701f54e073a911b163fd348210f11ee 100644
--- a/net/extras/sqlite/sqlite_channel_id_store.cc
+++ b/net/extras/sqlite/sqlite_channel_id_store.cc
@@ -17,6 +17,7 @@
#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/sequenced_task_runner.h"
+#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "crypto/ec_private_key.h"
#include "net/cert/asn1_util.h"
@@ -526,12 +527,8 @@ void SQLiteChannelIDStore::Backend::PrunePendingOperationsForDeletes(
for (PendingOperationsList::iterator it = pending_.begin();
it != pending_.end();) {
- bool remove =
- std::find(server_identifiers.begin(), server_identifiers.end(),
- (*it)->channel_id().server_identifier()) !=
- server_identifiers.end();
-
- if (remove) {
+ if (base::ContainsValue(server_identifiers,
+ (*it)->channel_id().server_identifier())) {
std::unique_ptr<PendingOperation> po(*it);
it = pending_.erase(it);
--num_pending_;
« no previous file with comments | « net/dns/host_resolver_impl_unittest.cc ('k') | net/http/http_security_headers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698