Skip to content

Commit

Permalink
base/json: Collapse a condition in ReadHexDigits into a single if cla…
Browse files Browse the repository at this point in the history
…use.

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
  • Loading branch information
tfarina@chromium.org committed Oct 18, 2011
1 parent 3d588af commit 967704b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions base/json/json_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 967704b

Please sign in to comment.