Replace for each loops
BUG=655950 Review-Url: https://codereview.chromium.org/2459243002 Cr-Commit-Position: refs/heads/master@{#429052}
This commit is contained in:

committed by
Commit bot

parent
fbebed7815
commit
9bd6ef5d4c
1
AUTHORS
1
AUTHORS
@ -730,6 +730,7 @@ Yoav Weiss <yoav@yoav.ws>
|
||||
Yoav Zilberberg <yoav.zilberberg@gmail.com>
|
||||
Yong Shin <sy3620@gmail.com>
|
||||
Yongsheng Zhu <yongsheng.zhu@intel.com>
|
||||
Yoonjae Cho <yoonjae.cho92@gmail.com>
|
||||
Yoshinori Sano <yoshinori.sano@gmail.com>
|
||||
Youngho Seo <hazivoo@gmail.com>
|
||||
YoungKi Hong <simon.hong81@gmail.com>
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user