lib/upnp/ContentDirectoryService: getFriendlyName() returns std::string reference

This can avoid the overhead of casting a C string back to std::string_view.
This commit is contained in:
Max Kellermann
2024-01-04 13:21:53 +01:00
parent 1789b56a85
commit b2ed29b8c0
3 changed files with 10 additions and 11 deletions

View File

@@ -91,21 +91,21 @@ UpnpNeighborExplorer::GetList() const noexcept
List result;
for (const auto &i : tmp)
result.emplace_front(i.GetURI(), i.getFriendlyName());
result.emplace_front(i.GetURI(), i.GetFriendlyName());
return result;
}
void
UpnpNeighborExplorer::FoundUPnP(const ContentDirectoryService &service)
{
const NeighborInfo n(service.GetURI(), service.getFriendlyName());
const NeighborInfo n(service.GetURI(), service.GetFriendlyName());
listener.FoundNeighbor(n);
}
void
UpnpNeighborExplorer::LostUPnP(const ContentDirectoryService &service)
{
const NeighborInfo n(service.GetURI(), service.getFriendlyName());
const NeighborInfo n(service.GetURI(), service.GetFriendlyName());
listener.LostNeighbor(n);
}