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>
This commit is contained in:
Anna Henningsen authored and Myles Borins committed 2018-02-12 19:28:37 -05:00
1 parent 57865a9213
commit 9181fbb699
1 file changed
+8 -6
+8 -6
View File
@@ -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