mirror of
https://github.com/transmission/transmission
synced 2024-12-21 23:32:35 +00:00
refactor: simplify addrinfo unique_ptr definition (#7060)
This commit is contained in:
parent
dbea32809a
commit
7e2212bfe0
1 changed files with 1 additions and 4 deletions
|
@ -512,10 +512,7 @@ private:
|
|||
fmt::arg("error_code", static_cast<int>(rc))));
|
||||
return {};
|
||||
}
|
||||
auto const info_uniq = std::unique_ptr<addrinfo, void (*)(addrinfo*)>{
|
||||
info,
|
||||
[](addrinfo* p) { freeaddrinfo(p); }, // MSVC forced me to write this lambda wrapper
|
||||
};
|
||||
auto const info_uniq = std::unique_ptr<addrinfo, decltype(&freeaddrinfo)>{ info, freeaddrinfo };
|
||||
|
||||
// N.B. getaddrinfo() will return IPv4-mapped addresses by default on macOS
|
||||
auto socket_address = tr_socket_address::from_sockaddr(info->ai_addr);
|
||||
|
|
Loading…
Reference in a new issue