Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: tools/clang/blink_gc_plugin/JsonWriter.h

Issue 2009293002: Cleanup: Pass std::string as const reference from tools/clang/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert tools/clang/empty_string/tests/test-original.cc Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/blink_gc_plugin/JsonWriter.h
diff --git a/tools/clang/blink_gc_plugin/JsonWriter.h b/tools/clang/blink_gc_plugin/JsonWriter.h
index 3fe79103bbadbadc21770b707584ba1648462ed4..d1615639fba8b73251db193b903de340db2976f7 100644
--- a/tools/clang/blink_gc_plugin/JsonWriter.h
+++ b/tools/clang/blink_gc_plugin/JsonWriter.h
@@ -18,7 +18,7 @@ class JsonWriter {
*os_ << "[";
state_.push(false);
}
- void OpenList(const std::string key) {
+ void OpenList(const std::string& key) {
Write(key);
*os_ << ":";
OpenList();
@@ -40,15 +40,15 @@ class JsonWriter {
Separator();
*os_ << val;
}
- void Write(const std::string val) {
+ void Write(const std::string& val) {
Separator();
*os_ << "\"" << val << "\"";
}
- void Write(const std::string key, const size_t val) {
+ void Write(const std::string& key, const size_t val) {
Separator();
*os_ << "\"" << key << "\":" << val;
}
- void Write(const std::string key, const std::string val) {
+ void Write(const std::string& key, const std::string val) {
hans 2016/05/25 17:45:57 Should probably pass 'val' by reference to while w
ki.stfu 2016/05/25 17:53:07 Missed that, thanks :)
Separator();
*os_ << "\"" << key << "\":\"" << val << "\"";
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698