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

Unified Diff: net/http/http_security_headers.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/extras/sqlite/sqlite_channel_id_store.cc ('k') | net/http/http_security_headers_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_security_headers.cc
diff --git a/net/http/http_security_headers.cc b/net/http/http_security_headers.cc
index e67eadf7febe37c8563da89b1c2c364feaf6e9a4..cab2fff9e4c7f0d96acc0b67c1f40b67a9182d9d 100644
--- a/net/http/http_security_headers.cc
+++ b/net/http/http_security_headers.cc
@@ -5,6 +5,7 @@
#include <limits>
#include "base/base64.h"
+#include "base/stl_util.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/string_util.h"
@@ -49,8 +50,7 @@ bool MaxAgeToLimitedInt(std::string::const_iterator begin,
bool IsBackupPinPresent(const HashValueVector& pins,
const HashValueVector& from_cert_chain) {
for (const auto& pin : pins) {
- auto p = std::find(from_cert_chain.begin(), from_cert_chain.end(), pin);
- if (p == from_cert_chain.end())
+ if (!base::ContainsValue(from_cert_chain, pin))
return true;
}
return false;
@@ -61,8 +61,7 @@ bool IsBackupPinPresent(const HashValueVector& pins,
bool HashesIntersect(const HashValueVector& a,
const HashValueVector& b) {
for (const auto& pin : a) {
- auto p = std::find(b.begin(), b.end(), pin);
- if (p != b.end())
+ if (base::ContainsValue(b, pin))
return true;
}
return false;
« no previous file with comments | « net/extras/sqlite/sqlite_channel_id_store.cc ('k') | net/http/http_security_headers_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698