diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-01-23 20:09:42 +0100 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2018-02-12 19:28:37 -0500 |
commit | 9181fbb6991418efe8887dcd0b672bb1f901c64a (patch) | |
tree | 6e7222c2186902b307aa43f2dbc6c39a3d485521 | |
parent | 57865a9213c1706de603e29b7647a6040bcc828f (diff) | |
download | node-new-9181fbb6991418efe8887dcd0b672bb1f901c64a.tar.gz |
src: dumb down code by removing std::move
This would require C++11 features that would
otherwise not be available on clang + OS X on Node 6.x.
PR-URL: https://github.com/nodejs/node/pull/18324
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
-rw-r--r-- | src/node_url.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/node_url.cc b/src/node_url.cc index 82d411d03c..0e5c395b13 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -100,14 +100,16 @@ class URLHost { // internals too much. // These helpers are the easiest solution but we might want to consider // just not forcing strings into an union. - inline void SetOpaque(std::string&& string) { + inline void SetOpaque(std::string* string) { type_ = HostType::H_OPAQUE; - new(&value_.opaque) std::string(std::move(string)); + new(&value_.opaque) std::string(); + value_.opaque.swap(*string); } - inline void SetDomain(std::string&& string) { + inline void SetDomain(std::string* string) { type_ = HostType::H_DOMAIN; - new(&value_.domain) std::string(std::move(string)); + new(&value_.domain) std::string(); + value_.domain.swap(*string); } }; @@ -865,7 +867,7 @@ void URLHost::ParseOpaqueHost(const char* input, size_t length) { } } - SetOpaque(std::move(output)); + SetOpaque(&output); } void URLHost::ParseHost(const char* input, @@ -913,7 +915,7 @@ void URLHost::ParseHost(const char* input, return; // It's not an IPv4 or IPv6 address, it must be a domain - SetDomain(std::move(decoded)); + SetDomain(&decoded); } // Locates the longest sequence of 0 segments in an IPv6 address |