From cbe7d052e8b160a67f422f8bfc1e83f04516497c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 4 Sep 2019 11:44:54 +0200 Subject: [PATCH] db/simple/Song: use PathTraitsUTF8::Build() --- src/db/plugins/simple/Song.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/db/plugins/simple/Song.cxx b/src/db/plugins/simple/Song.cxx index fa3c48c00..f5b0b539e 100644 --- a/src/db/plugins/simple/Song.cxx +++ b/src/db/plugins/simple/Song.cxx @@ -22,6 +22,7 @@ #include "tag/Tag.hxx" #include "song/DetachedSong.hxx" #include "song/LightSong.hxx" +#include "fs/Traits.hxx" #include "util/StringView.hxx" inline @@ -60,13 +61,7 @@ Song::GetURI() const noexcept return uri; else { const char *path = parent.GetPath(); - - std::string result; - result.reserve(strlen(path) + 1 + uri.length()); - result.assign(path); - result.push_back('/'); - result.append(uri); - return result; + return PathTraitsUTF8::Build(path, uri.c_str()); } }