mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 12:12:15 +02:00
IP::Addr::from_ipv[4|6](): use move semantics
Signed-off-by: James Yonan <james@openvpn.net>
This commit is contained in:
parent
a264f99339
commit
25146d8539
@ -148,19 +148,19 @@ namespace openvpn {
|
||||
throw ip_exception("address unspecified");
|
||||
}
|
||||
|
||||
static Addr from_ipv4(const IPv4::Addr& addr)
|
||||
static Addr from_ipv4(IPv4::Addr addr)
|
||||
{
|
||||
Addr a;
|
||||
a.ver = V4;
|
||||
a.u.v4 = addr;
|
||||
a.u.v4 = std::move(addr);
|
||||
return a;
|
||||
}
|
||||
|
||||
static Addr from_ipv6(const IPv6::Addr& addr)
|
||||
static Addr from_ipv6(IPv6::Addr addr)
|
||||
{
|
||||
Addr a;
|
||||
a.ver = V6;
|
||||
a.u.v6 = addr;
|
||||
a.u.v6 = std::move(addr);
|
||||
return a;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user