Commit 26b850c1 authored by Max Kellermann's avatar Max Kellermann

db/upnp: use std::replace() in titleToPath()

parent 9941735a
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "Log.hxx" #include "Log.hxx"
#include "SongFilter.hxx" #include "SongFilter.hxx"
#include <algorithm>
#include <string> #include <string>
#include <vector> #include <vector>
#include <map> #include <map>
...@@ -216,17 +217,10 @@ UpnpDatabase::ReturnSong(Song *song) const ...@@ -216,17 +217,10 @@ UpnpDatabase::ReturnSong(Song *song) const
*/ */
gcc_pure gcc_pure
static std::string static std::string
titleToPathElt(const std::string &in) titleToPathElt(std::string s)
{ {
std::string out; std::replace(s.begin(), s.end(), '/', '_');
for (auto it = in.begin(); it != in.end(); it++) { return s;
if (*it == '/') {
out += '_';
} else {
out += *it;
}
}
return out;
} }
// If uri is empty, we use the object's url instead. This happens // If uri is empty, we use the object's url instead. This happens
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment