Chromium Code Reviews| Index: url/gurl.cc |
| diff --git a/url/gurl.cc b/url/gurl.cc |
| index c22236f89e533129d935f22f5f714b2109125fea..ca46798831fcc0390c28555e805c6a6ffc5c496a 100644 |
| --- a/url/gurl.cc |
| +++ b/url/gurl.cc |
| @@ -98,10 +98,21 @@ GURL::GURL(const char* canonical_spec, |
| InitializeFromCanonicalSpec(); |
| } |
| -GURL::GURL(std::string canonical_spec, const url::Parsed& parsed, bool is_valid) |
| - : is_valid_(is_valid), |
| +GURL::GURL(const std::string& canonical_spec, |
| + const url::Parsed& parsed, |
| + bool is_valid) |
| + : spec_(canonical_spec), |
| + is_valid_(is_valid), |
| + parsed_(parsed) { |
| + InitializeFromCanonicalSpec(); |
| +} |
| + |
| +GURL::GURL(std::string&& canonical_spec, |
| + const url::Parsed& parsed, |
| + bool is_valid) noexcept |
| + : spec_(std::move(canonical_spec)), |
|
danakj
2016/04/29 02:17:54
Doing this instead of swap is cool.
ki.stfu
2016/05/25 16:53:33
I'm glad to make you happy! :)
|
| + is_valid_(is_valid), |
| parsed_(parsed) { |
| - spec_.swap(canonical_spec); |
| InitializeFromCanonicalSpec(); |
| } |