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/core/hle/service/filesystem/filesystem.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/core/hle/service') 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 -- cgit v1.2.3