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

Unified Diff: net/http/transport_security_state.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/http/http_security_headers_unittest.cc ('k') | net/log/net_log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/transport_security_state.cc
diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_state.cc
index 422380bc834c25fbdabb173cf625b8452dde5dd6..73626e0411ef194af6fa75f782c3fd6c36edc074 100644
--- a/net/http/transport_security_state.cc
+++ b/net/http/transport_security_state.cc
@@ -4,7 +4,6 @@
#include "net/http/transport_security_state.h"
-#include <algorithm>
#include <memory>
#include <utility>
#include <vector>
@@ -17,6 +16,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
#include "base/sha1.h"
+#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -224,8 +224,7 @@ std::string HashHost(const std::string& canonicalized_host) {
bool HashesIntersect(const HashValueVector& a,
const HashValueVector& b) {
for (const auto& hash : a) {
- auto p = std::find(b.begin(), b.end(), hash);
- if (p != b.end())
+ if (base::ContainsValue(b, hash))
return true;
}
return false;
« no previous file with comments | « net/http/http_security_headers_unittest.cc ('k') | net/log/net_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698