summaryrefslogtreecommitdiffstats
path: root/base/json/json_reader.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-18 19:04:55 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-18 19:04:55 +0000
commit967704ba1cef1061a901c971a369ed54e67db5f9 (patch)
tree7aaeda48c6f33b10c191a03c164ea7f97d4731d0 /base/json/json_reader.cc
parent3d588af3b50749227b6499942d4454f360fdc3bf (diff)
downloadchromium_src-967704ba1cef1061a901c971a369ed54e67db5f9.zip
chromium_src-967704ba1cef1061a901c971a369ed54e67db5f9.tar.gz
chromium_src-967704ba1cef1061a901c971a369ed54e67db5f9.tar.bz2
base/json: Collapse a condition in ReadHexDigits into a single if clause.
TEST=base_unittests --gtest_filter=JSON* R=tony@chromium.org Review URL: http://codereview.chromium.org/8312004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/json/json_reader.cc')
-rw-r--r--base/json/json_reader.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/base/json/json_reader.cc b/base/json/json_reader.cc
index f6bdc35..bbaf5fb 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;
}