diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-06 18:40:41 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-06 18:40:41 +0000 |
commit | 32c438e297c499e8444c0b5c19e2c4fa155375ff (patch) | |
tree | 8b71c471ad31093e5ba05409295c0e85d718fd78 /base | |
parent | a48bb10d665602130c35569ae2135e81a4d85d4d (diff) | |
download | chromium_src-32c438e297c499e8444c0b5c19e2c4fa155375ff.zip chromium_src-32c438e297c499e8444c0b5c19e2c4fa155375ff.tar.gz chromium_src-32c438e297c499e8444c0b5c19e2c4fa155375ff.tar.bz2 |
base/json: Make ReadHexDigits easier to read by using IsHexDigit() function.
TEST=base_unittests --gtest_filter=JSON*
R=tony@chromium.org
Review URL: http://codereview.chromium.org/7833020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99774 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/json/json_reader.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/base/json/json_reader.cc b/base/json/json_reader.cc index d3d712a..748cc4e 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; |