refactor: dedupe `if_nametoindex()` call

This commit is contained in:
Yat Ho 2024-04-07 18:21:24 +08:00
parent 8de4269047
commit 5e8ab62de5
1 changed files with 1 additions and 1 deletions

View File

@ -637,7 +637,7 @@ std::optional<unsigned> tr_address::to_interface_index() const noexcept
{
auto const ret = if_nametoindex(ifa->ifa_name);
tr_logAddDebug(fmt::format("Found interface index for {}: {}", display_name(), ret));
return if_nametoindex(ifa->ifa_name);
return ret;
}
}
#endif