diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-16 15:23:30 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-16 15:23:30 +0000 |
commit | 6e680cfca66d0461f2824ccb5128e4f9cbb20bb6 (patch) | |
tree | 8810c22ec7ab357f5cc15cc508565d2a9872dcf5 /base/string_util.cc | |
parent | 97570b99a4341b1d1d6512f5d82b43c3123eb927 (diff) | |
download | chromium_src-6e680cfca66d0461f2824ccb5128e4f9cbb20bb6.zip chromium_src-6e680cfca66d0461f2824ccb5128e4f9cbb20bb6.tar.gz chromium_src-6e680cfca66d0461f2824ccb5128e4f9cbb20bb6.tar.bz2 |
Rewrite base::JSONReader to be 35-40% faster, depending on the input string.
This change does the following:
* Parses the input string and generates the object representation in O(n) time.
* Optimizes string decoding by using StringPiece where possible, which also
introduces the JSON_DETACHABLE_CHILDREN parser option.
* Makes JSONReader a simpler interface by hiding the parser details in an
internal JSONParser class.
BUG=49212,111581,121469
TEST=Hopefully covered by all test suites. New tests added for edge cases.
Review URL: https://chromiumcodereview.appspot.com/10035042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137430 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_util.cc')
-rw-r--r-- | base/string_util.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/base/string_util.cc b/base/string_util.cc index fd6fccc..2eecb79 100644 --- a/base/string_util.cc +++ b/base/string_util.cc @@ -472,7 +472,7 @@ bool IsStringUTF8(const std::string& str) { int32 code_point; CBU8_NEXT(src, char_index, src_len, code_point); if (!base::IsValidCharacter(code_point)) - return false; + return false; } return true; } |