diff options
| author | 2023-12-16 11:47:29 -0500 | |
|---|---|---|
| committer | 2023-12-16 11:47:29 -0500 | |
| commit | 360418f1a14cdbc39bd84231f56d4c1b57ee5e39 (patch) | |
| tree | 362313094902d38e0a7dbab1193e543120e21483 /src/core/hle/service/filesystem | |
| parent | Merge pull request #12344 from liamwhite/its-free-real-estate (diff) | |
| parent | Improve path splitting speed (diff) | |
| download | yuzu-360418f1a14cdbc39bd84231f56d4c1b57ee5e39.tar.gz yuzu-360418f1a14cdbc39bd84231f56d4c1b57ee5e39.tar.xz yuzu-360418f1a14cdbc39bd84231f56d4c1b57ee5e39.zip | |
Merge pull request #12290 from liamwhite/deferred-path-split
Improve path splitting speed
Diffstat (limited to 'src/core/hle/service/filesystem')
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 6 |
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 |