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

Unified Diff: net/http/http_response_headers.cc

Issue 1878083002: Implement IsAsciiUpper and IsAsciiLower in base/strings/string_util.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git sync Created 4 years, 8 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
Index: net/http/http_response_headers.cc
diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc
index 659b3ca3fba820be8ef24da72c2ba4dd3d429c22..2f89d1f3024b8721dfd2e7fdb83e4e8e765f8602 100644
--- a/net/http/http_response_headers.cc
+++ b/net/http/http_response_headers.cc
@@ -655,7 +655,7 @@ HttpVersion HttpResponseHeaders::ParseVersion(
++p; // from / to first digit.
++dot; // from . to second digit.
- if (!(*p >= '0' && *p <= '9' && *dot >= '0' && *dot <= '9')) {
+ if (!(base::IsAsciiDigit(*p) && base::IsAsciiDigit(*dot))) {
DVLOG(1) << "malformed version number";
return HttpVersion();
}
@@ -710,7 +710,7 @@ void HttpResponseHeaders::ParseStatusLine(
++p;
std::string::const_iterator code = p;
- while (p < line_end && *p >= '0' && *p <= '9')
+ while (p < line_end && base::IsAsciiDigit(*p))
++p;
if (p == code) {

Powered by Google App Engine
This is Rietveld 408576698