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

Unified Diff: url/gurl.cc

Issue 1360533002: Cleanup: Initialize GURL 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 | « url/gurl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/gurl.cc
diff --git a/url/gurl.cc b/url/gurl.cc
index 2b67beebc498d4a44bb224135110faa5ad324c65..b5cb7daf3c02f20d6dc76a3a99a275762ededb55 100644
--- a/url/gurl.cc
+++ b/url/gurl.cc
@@ -101,9 +101,7 @@ GURL::GURL(const char* canonical_spec,
}
GURL::GURL(std::string canonical_spec, const url::Parsed& parsed, bool is_valid)
- : is_valid_(is_valid),
- parsed_(parsed) {
- spec_.swap(canonical_spec);
+ : spec_(std::move(canonical_spec)), is_valid_(is_valid), parsed_(parsed) {
InitializeFromCanonicalSpec();
}
« no previous file with comments | « url/gurl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698