db/upnp: eliminate temporary std::string from Visit()

This commit is contained in:
Max Kellermann 2024-01-04 16:03:08 +01:00
parent 4eefc2e47c
commit 2c77e088b4
1 changed files with 2 additions and 2 deletions

View File

@ -33,6 +33,7 @@
#include <string.h>
static const char *const rootid = "0";
static constexpr std::string_view rootid_sv{rootid};
class UpnpSongData {
protected:
@ -602,10 +603,9 @@ UpnpDatabase::Visit(const DatabaseSelection &selection,
}
// We do have a path: the first element selects the server
std::string servername(vpath.front());
auto server = discovery->GetServer(vpath.front());
vpath.pop_front();
auto server = discovery->GetServer(servername.c_str());
VisitServer(server, std::move(vpath), selection,
visit_directory, visit_song, visit_playlist);
helper.Commit();