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

Unified Diff: base/json/json_reader.cc

Issue 8312004: base/json: Collapse a condition in ReadHexDigits into a single if clause. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 f6bdc357a6520d500076628802f400d297cf54ac..bbaf5fb349bcf396d9fa26f6ba0269faac0d9315 100644
--- a/base/json/json_reader.cc
+++ b/base/json/json_reader.cc
@@ -51,9 +51,7 @@ bool ReadInt(base::JSONReader::Token& token, bool can_have_leading_zeros) {
bool ReadHexDigits(base::JSONReader::Token& token, int digits) {
for (int i = 1; i <= digits; ++i) {
wchar_t c = *(token.begin + token.length + i);
- if ('\0' == c)
- return false;
- if (!IsHexDigit(c))
+ if (c == '\0' || !IsHexDigit(c))
return false;
}
« 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