aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-23 00:06:03 +0100
committerMax Kellermann <max@duempel.org>2014-01-23 00:06:03 +0100
commit3ac15ca8d170c0d2d58cff8b6d9ea5019475805f (patch)
tree2febafb5d1990e2f25af39427a4c29cfe680ba29
parentf703d4fc3e55f58ad4777f45e07e5784f0699c64 (diff)
downloadmpd-3ac15ca8d170c0d2d58cff8b6d9ea5019475805f.tar.gz
mpd-3ac15ca8d170c0d2d58cff8b6d9ea5019475805f.tar.xz
mpd-3ac15ca8d170c0d2d58cff8b6d9ea5019475805f.zip
db/upnp: pass char* to visitSong()
Don't use std::string, reduce bloat.
Diffstat (limited to '')
-rw-r--r--src/db/UpnpDatabasePlugin.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/db/UpnpDatabasePlugin.cxx b/src/db/UpnpDatabasePlugin.cxx
index 47d2d0dd0..c36fd4c2a 100644
--- a/src/db/UpnpDatabasePlugin.cxx
+++ b/src/db/UpnpDatabasePlugin.cxx
@@ -350,7 +350,7 @@ UpnpDatabase::SearchSongs(const ContentDirectoryService &server,
}
static bool
-visitSong(const UPnPDirObject &meta, std::string &&path,
+visitSong(const UPnPDirObject &meta, const char *path,
const DatabaseSelection &selection,
VisitSong visit_song, Error& error)
{
@@ -359,7 +359,7 @@ visitSong(const UPnPDirObject &meta, std::string &&path,
LightSong song;
song.directory = nullptr;
- song.uri = path.c_str();
+ song.uri = path;
song.real_uri = meta.url.c_str();
song.tag = &meta.tag;
song.mtime = 0;
@@ -414,9 +414,9 @@ UpnpDatabase::SearchSongs(const ContentDirectoryService &server,
// course, 'All Music' is very big.
// So we return synthetic and ugly paths based on the object id,
// which we later have to detect.
- if (!visitSong(std::move(dirent),
- songPath(server.getFriendlyName(),
- dirent.m_id),
+ const std::string path = songPath(server.getFriendlyName(),
+ dirent.m_id);
+ if (!visitSong(std::move(dirent), path.c_str(),
selection, visit_song,
error))
return false;
@@ -574,7 +574,7 @@ UpnpDatabase::VisitServer(const ContentDirectoryService &server,
case UPnPDirObject::ItemClass::MUSIC:
if (visit_song)
return visitSong(std::move(tdirent),
- std::string(selection.uri),
+ selection.uri.c_str(),
selection, visit_song,
error);
break;