From d5de9402ee22eea985d6842baafd8922e15d3784 Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Tue, 5 Dec 2023 23:17:19 -0500 Subject: Improve path splitting speed --- src/common/fs/path_util.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/common/fs/path_util.h') diff --git a/src/common/fs/path_util.h b/src/common/fs/path_util.h index 2874ea738..23c8b1359 100644 --- a/src/common/fs/path_util.h +++ b/src/common/fs/path_util.h @@ -289,7 +289,11 @@ enum class DirectorySeparator { // Splits the path on '/' or '\' and put the components into a vector // i.e. "C:\Users\Yuzu\Documents\save.bin" becomes {"C:", "Users", "Yuzu", "Documents", "save.bin" } -[[nodiscard]] std::vector SplitPathComponents(std::string_view filename); +[[nodiscard]] std::vector SplitPathComponents(std::string_view filename); + +// Splits the path on '/' or '\' and put the components into a vector +// i.e. "C:\Users\Yuzu\Documents\save.bin" becomes {"C:", "Users", "Yuzu", "Documents", "save.bin" } +[[nodiscard]] std::vector SplitPathComponentsCopy(std::string_view filename); // Removes trailing slash, makes all '\\' into '/', and removes duplicate '/'. Makes '/' into '\\' // depending if directory_separator is BackwardSlash or PlatformDefault and running on windows -- cgit v1.2.3