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

Unified Diff: base/json/json_reader.cc

Issue 7833020: base/json: Make ReadHexDigits easier to read by using IsHexDigit() function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_reader.cc
diff --git a/base/json/json_reader.cc b/base/json/json_reader.cc
index d3d712a5b74540e13c63b16b7b568a0f1510914a..748cc4e263f6cd153a0dd725ddb343f391443e10 100644
--- a/base/json/json_reader.cc
+++ b/base/json/json_reader.cc
@@ -53,10 +53,8 @@ bool ReadHexDigits(base::JSONReader::Token& token, int digits) {
wchar_t c = *(token.begin + token.length + i);
if ('\0' == c)
return false;
- if (!(('0' <= c && c <= '9') || ('a' <= c && c <= 'f') ||
- ('A' <= c && c <= 'F'))) {
+ if (!IsHexDigit(c))
return false;
- }
}
token.length += digits;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698