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

Unified Diff: tools/gn/value.cc

Issue 1350043004: Cleanup: Initialize Value from tools/gn by moving std::string (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass by value and then move it 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/gn/value.cc
diff --git a/tools/gn/value.cc b/tools/gn/value.cc
index 1bf0bb7a302a24fba128ddd2fddbe23627eb06ef..9a52fbaa0576a11b08cbe789bd47c6d811f3ac41 100644
--- a/tools/gn/value.cc
+++ b/tools/gn/value.cc
@@ -41,12 +41,10 @@ Value::Value(const ParseNode* origin, int64_t int_val)
Value::Value(const ParseNode* origin, std::string str_val)
: type_(STRING),
- string_value_(),
+ string_value_(std::move(str_val)),
boolean_value_(false),
int_value_(0),
- origin_(origin) {
- string_value_.swap(str_val);
-}
+ origin_(origin) {}
Value::Value(const ParseNode* origin, const char* str_val)
: type_(STRING),
« 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