Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3246)

Issue 112940044: Avoid string copying in json.cc. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 10 months ago by Rouslan Solomakhin
Modified:
9 years, 10 months ago
CC:
lararennie, keghani, davinci_google, dbeaumont
Base URL:
https://libaddressinput.googlecode.com/svn/trunk
Visibility:
Public.

Description

Avoid string copying in json.cc. The following two methods: bool Json::HasStringValueForKey(const std::string& key) const; std::string Json::GetStringValueForKey(const std::string& key) const; have been replaced with a single method: bool Json::GetStringValueForKey(const std::string& key, std::string* value) const; to avoid copying possibly large strings. BUG=8 R=roubert@google.com Committed: https://code.google.com/p/libaddressinput/source/detail?r=303

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+70 lines, -89 lines) Patch
M cpp/src/preload_supplier.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M cpp/src/rule.cc View 4 chunks +29 lines, -48 lines 0 comments Download
M cpp/src/util/json.h View 1 chunk +5 lines, -9 lines 1 comment Download
M cpp/src/util/json.cc View 1 chunk +9 lines, -13 lines 0 comments Download
M cpp/test/util/json_test.cc View 4 chunks +25 lines, -17 lines 0 comments Download

Messages

Total messages: 4
Rouslan Solomakhin
Fredrik: PTAL.
9 years, 10 months ago (2014-07-10 17:39:49 UTC) #1
roubert (google)
LGTM
9 years, 10 months ago (2014-07-10 17:58:00 UTC) #2
Rouslan Solomakhin
Committed patchset #1 manually as r303 (presubmit successful).
9 years, 10 months ago (2014-07-10 17:58:43 UTC) #3
estade
9 years, 10 months ago (2014-07-10 18:03:17 UTC) #4
Message was sent while issue was closed.
https://codereview.appspot.com/112940044/diff/1/cpp/src/util/json.h
File cpp/src/util/json.h (right):

https://codereview.appspot.com/112940044/diff/1/cpp/src/util/json.h#newcode55
cpp/src/util/json.h:55: bool HasDictionaryValueForKey(const std::string& key)
const;
I would change this API as well for consistency's sake, even though you're not
avoiding a Json copy.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b