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

Unified Diff: net/base/parse_number.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/base/parse_number.cc
diff --git a/net/base/parse_number.cc b/net/base/parse_number.cc
index 365aa350b472c1f58e29903d91943f4fcc69c096..460947f70af7645c3d3e78de4695cdd727c2cf0f 100644
--- a/net/base/parse_number.cc
+++ b/net/base/parse_number.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_util.h"
namespace net {
@@ -51,7 +52,7 @@ bool ParseIntHelper(const base::StringPiece& input,
return SetError(ParseIntError::FAILED_PARSE, optional_error);
bool starts_with_negative = input[0] == '-';
- bool starts_with_digit = input[0] >= '0' && input[0] <= '9';
+ bool starts_with_digit = base::IsAsciiDigit(input[0]);
if (!starts_with_digit) {
if (format == ParseIntFormat::NON_NEGATIVE || !starts_with_negative)

Powered by Google App Engine
This is Rietveld 408576698