Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[squash] make linter happy
  • Loading branch information
addaleax committed Jan 24, 2018
commit 71b5a61e698a534384ae380c351e605a6a4607da
12 changes: 6 additions & 6 deletions src/node_url.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +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();
value_.opaque.swap(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();
value_.domain.swap(string);
value_.domain.swap(*string);
}
};

Expand Down Expand Up @@ -867,7 +867,7 @@ void URLHost::ParseOpaqueHost(const char* input, size_t length) {
}
}

SetOpaque(output);
SetOpaque(&output);
}

void URLHost::ParseHost(const char* input,
Expand Down Expand Up @@ -915,7 +915,7 @@ void URLHost::ParseHost(const char* input,
return;

// It's not an IPv4 or IPv6 address, it must be a domain
SetDomain(decoded);
SetDomain(&decoded);
}

// Locates the longest sequence of 0 segments in an IPv6 address
Expand Down