From 817d87a0a7be3597ce1ae60b305a1dffa491db2d Mon Sep 17 00:00:00 2001 From: gibbed Date: Mon, 20 Apr 2020 00:29:43 -0500 Subject: [PATCH] [Base] Join paths better. [Base] Join paths better, so the first iteration isn't a join of an empty string with the first path part. --- src/xenia/base/utf8.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/xenia/base/utf8.cc b/src/xenia/base/utf8.cc index 5cb067991..22d78f9cf 100644 --- a/src/xenia/base/utf8.cc +++ b/src/xenia/base/utf8.cc @@ -500,8 +500,12 @@ std::string join_paths(const std::string_view left_path, std::string join_paths(std::vector paths, char32_t sep) { std::string result; - for (const auto& path : paths) { - result = join_paths(result, path, sep); + auto it = paths.cbegin(); + if (it != paths.cend()) { + result = *it++; + for (; it != paths.cend(); ++it) { + result = join_paths(result, *it, sep); + } } return result; }