summaryrefslogtreecommitdiff
path: root/src/core/hle/service/filesystem
diff options
context:
space:
mode:
authorGravatar BreadFish642023-12-05 23:17:19 -0500
committerGravatar Liam2023-12-05 23:17:19 -0500
commitd5de9402ee22eea985d6842baafd8922e15d3784 (patch)
treef302a3a87aad12213c36ef00cd28c86e3e27ba61 /src/core/hle/service/filesystem
parentMerge pull request #12271 from liamwhite/pretext-fix (diff)
downloadyuzu-d5de9402ee22eea985d6842baafd8922e15d3784.tar.gz
yuzu-d5de9402ee22eea985d6842baafd8922e15d3784.tar.xz
yuzu-d5de9402ee22eea985d6842baafd8922e15d3784.zip
Improve path splitting speed
Diffstat (limited to 'src/core/hle/service/filesystem')
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index 508db7360..780f8c74d 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -104,11 +104,7 @@ Result VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) con
104 const auto components = Common::FS::SplitPathComponents(path); 104 const auto components = Common::FS::SplitPathComponents(path);
105 std::string relative_path; 105 std::string relative_path;
106 for (const auto& component : components) { 106 for (const auto& component : components) {
107 // Skip empty path components 107 relative_path = Common::FS::SanitizePath(fmt::format("{}/{}", relative_path, component));
108 if (component.empty()) {
109 continue;
110 }
111 relative_path = Common::FS::SanitizePath(relative_path + '/' + component);
112 auto new_dir = backing->CreateSubdirectory(relative_path); 108 auto new_dir = backing->CreateSubdirectory(relative_path);
113 if (new_dir == nullptr) { 109 if (new_dir == nullptr) {
114 // TODO(DarkLordZach): Find a better error code for this 110 // TODO(DarkLordZach): Find a better error code for this