diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2023-12-16 11:47:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-16 11:47:29 -0500 |
| commit | 360418f1a14cdbc39bd84231f56d4c1b57ee5e39 (patch) | |
| tree | 362313094902d38e0a7dbab1193e543120e21483 /src/core/hle/service/filesystem | |
| parent | 3bc7575c47f2460b249702c2844687b6c0106cc8 (diff) | |
| parent | d5de9402ee22eea985d6842baafd8922e15d3784 (diff) | |
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 const auto components = Common::FS::SplitPathComponents(path); std::string relative_path; for (const auto& component : components) { - // Skip empty path components - if (component.empty()) { - continue; - } - relative_path = Common::FS::SanitizePath(relative_path + '/' + component); + relative_path = Common::FS::SanitizePath(fmt::format("{}/{}", relative_path, component)); auto new_dir = backing->CreateSubdirectory(relative_path); if (new_dir == nullptr) { // TODO(DarkLordZach): Find a better error code for this |
