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

@@ -98,7 +98,7 @@ public:
}
/** Retrieve the "friendly name" for this server, useful for display. */
const char *getFriendlyName() const noexcept {
return m_friendlyName.c_str();
const std::string &GetFriendlyName() const noexcept {
return m_friendlyName;
}
};