Simplify std::filesystem usage a little in Boot.cpp

If path_b is absolute, (path_a / path_b) will be the same as path_b.
This commit is contained in:
JosJuice 2019-06-20 10:42:56 +02:00
parent fab15edb53
commit 9c33f658a5

View File

@ -88,9 +88,7 @@ static std::vector<std::string> ReadM3UFile(const std::string& m3u_path,
if (!line.empty() && line.front() != '#') // Comments start with #
{
#ifdef HAS_STD_FILESYSTEM
const fs::path path_line = fs::u8path(line);
const std::string path_to_add =
path_line.is_relative() ? (fs::u8path(folder_path) / path_line).u8string() : line;
const std::string path_to_add = (fs::u8path(folder_path) / fs::u8path(line)).u8string();
#else
const std::string path_to_add = line.front() != '/' ? folder_path + line : line;
#endif