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

Unified Diff: net/http/http_util.cc

Issue 2459243002: Replace for each loops (Closed)
Patch Set: Replace for each loops with format Created 4 years, 1 month 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 | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util.cc
diff --git a/net/http/http_util.cc b/net/http/http_util.cc
index aa2fdb6d66e9136695518474c52c53402774ffba..99b7192c838d500ce2bec2b783834f0bb94dfd22 100644
--- a/net/http/http_util.cc
+++ b/net/http/http_util.cc
@@ -345,8 +345,9 @@ bool HttpUtil::IsSafeHeader(const std::string& name) {
if (base::StartsWith(lower_name, "proxy-", base::CompareCase::SENSITIVE) ||
base::StartsWith(lower_name, "sec-", base::CompareCase::SENSITIVE))
return false;
- for (size_t i = 0; i < arraysize(kForbiddenHeaderFields); ++i) {
- if (lower_name == kForbiddenHeaderFields[i])
+
+ for (const char* field : kForbiddenHeaderFields) {
+ if (lower_name == field)
return false;
}
return true;
@@ -414,10 +415,12 @@ bool HttpUtil::IsNonCoalescingHeader(std::string::const_iterator name_begin,
// one.
"strict-transport-security"
};
- for (size_t i = 0; i < arraysize(kNonCoalescingHeaders); ++i) {
+
+ for (const char* header : kNonCoalescingHeaders) {
if (base::LowerCaseEqualsASCII(base::StringPiece(name_begin, name_end),
- kNonCoalescingHeaders[i]))
+ header)) {
return true;
+ }
}
return false;
}
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698