From 2c77e088b4ad963f06caa1021e69b401fc2a205d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 4 Jan 2024 16:03:08 +0100 Subject: [PATCH] db/upnp: eliminate temporary std::string from Visit() --- src/db/plugins/upnp/UpnpDatabasePlugin.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db/plugins/upnp/UpnpDatabasePlugin.cxx b/src/db/plugins/upnp/UpnpDatabasePlugin.cxx index c4abce24a..70978f56f 100644 --- a/src/db/plugins/upnp/UpnpDatabasePlugin.cxx +++ b/src/db/plugins/upnp/UpnpDatabasePlugin.cxx @@ -33,6 +33,7 @@ #include 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();