From 1789b56a852bca486f4cdd5f7ca61c020589f9ad Mon Sep 17 00:00:00 2001 From: Max Kellermann <max.kellermann@gmail.com> Date: Thu, 4 Jan 2024 13:22:31 +0100 Subject: [PATCH] db/upnp: pass std::string_view to songPath() --- src/db/plugins/upnp/UpnpDatabasePlugin.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/db/plugins/upnp/UpnpDatabasePlugin.cxx b/src/db/plugins/upnp/UpnpDatabasePlugin.cxx index baadb53e6..4b40544e5 100644 --- a/src/db/plugins/upnp/UpnpDatabasePlugin.cxx +++ b/src/db/plugins/upnp/UpnpDatabasePlugin.cxx @@ -24,6 +24,8 @@ #include "util/SplitString.hxx" #include "config/Block.hxx" +#include <fmt/core.h> + #include <cassert> #include <string> #include <utility> @@ -318,10 +320,10 @@ visitSong(const UPnPDirObject &meta, const char *path, * directory name would fit. */ static std::string -songPath(const std::string &servername, - const std::string &objid) noexcept +songPath(const std::string_view servername, + const std::string_view objid) noexcept { - return servername + "/" + rootid + "/" + objid; + return fmt::format("{}/{}/{}", servername, rootid, objid); } void