aboutsummaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-14 12:15:21 +0100
committerMax Kellermann <max@duempel.org>2014-01-14 12:15:21 +0100
commit26b850c15c605b4fc1404c4e8683791603f0e43c (patch)
tree31a177bdbb922816f8aacb68dce4768b19c6eef8 /src/db
parent9941735ae755403c6d53b7a239a143619c65743c (diff)
downloadmpd-26b850c15c605b4fc1404c4e8683791603f0e43c.tar.gz
mpd-26b850c15c605b4fc1404c4e8683791603f0e43c.tar.xz
mpd-26b850c15c605b4fc1404c4e8683791603f0e43c.zip
db/upnp: use std::replace() in titleToPath()
Diffstat (limited to 'src/db')
-rw-r--r--src/db/UpnpDatabasePlugin.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/db/UpnpDatabasePlugin.cxx b/src/db/UpnpDatabasePlugin.cxx
index d39bcdec9..ca7bebc0e 100644
--- a/src/db/UpnpDatabasePlugin.cxx
+++ b/src/db/UpnpDatabasePlugin.cxx
@@ -40,6 +40,7 @@
#include "Log.hxx"
#include "SongFilter.hxx"
+#include <algorithm>
#include <string>
#include <vector>
#include <map>
@@ -216,17 +217,10 @@ UpnpDatabase::ReturnSong(Song *song) const
*/
gcc_pure
static std::string
-titleToPathElt(const std::string &in)
+titleToPathElt(std::string s)
{
- std::string out;
- for (auto it = in.begin(); it != in.end(); it++) {
- if (*it == '/') {
- out += '_';
- } else {
- out += *it;
- }
- }
- return out;
+ std::replace(s.begin(), s.end(), '/', '_');
+ return s;
}
// If uri is empty, we use the object's url instead. This happens