0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 20:13:05 +02:00

IP::Addr::from_ipv[4|6](): use move semantics

Signed-off-by: James Yonan <james@openvpn.net>
This commit is contained in:
James Yonan 2017-08-18 23:49:16 -06:00 committed by Antonio Quartulli
parent a264f99339
commit 25146d8539

View File

@ -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;
}