diff options
| author | 2023-12-05 23:17:19 -0500 | |
|---|---|---|
| committer | 2023-12-05 23:17:19 -0500 | |
| commit | d5de9402ee22eea985d6842baafd8922e15d3784 (patch) | |
| tree | f302a3a87aad12213c36ef00cd28c86e3e27ba61 /src/core/file_sys/vfs.cpp | |
| parent | Merge pull request #12271 from liamwhite/pretext-fix (diff) | |
| download | yuzu-d5de9402ee22eea985d6842baafd8922e15d3784.tar.gz yuzu-d5de9402ee22eea985d6842baafd8922e15d3784.tar.xz yuzu-d5de9402ee22eea985d6842baafd8922e15d3784.zip | |
Improve path splitting speed
Diffstat (limited to 'src/core/file_sys/vfs.cpp')
| -rw-r--r-- | src/core/file_sys/vfs.cpp | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/core/file_sys/vfs.cpp b/src/core/file_sys/vfs.cpp index 639842401..b7105c8ff 100644 --- a/src/core/file_sys/vfs.cpp +++ b/src/core/file_sys/vfs.cpp | |||
| @@ -201,8 +201,6 @@ std::string VfsFile::GetFullPath() const { | |||
| 201 | 201 | ||
| 202 | VirtualFile VfsDirectory::GetFileRelative(std::string_view path) const { | 202 | VirtualFile VfsDirectory::GetFileRelative(std::string_view path) const { |
| 203 | auto vec = Common::FS::SplitPathComponents(path); | 203 | auto vec = Common::FS::SplitPathComponents(path); |
| 204 | vec.erase(std::remove_if(vec.begin(), vec.end(), [](const auto& str) { return str.empty(); }), | ||
| 205 | vec.end()); | ||
| 206 | if (vec.empty()) { | 204 | if (vec.empty()) { |
| 207 | return nullptr; | 205 | return nullptr; |
| 208 | } | 206 | } |
| @@ -237,8 +235,6 @@ VirtualFile VfsDirectory::GetFileAbsolute(std::string_view path) const { | |||
| 237 | 235 | ||
| 238 | VirtualDir VfsDirectory::GetDirectoryRelative(std::string_view path) const { | 236 | VirtualDir VfsDirectory::GetDirectoryRelative(std::string_view path) const { |
| 239 | auto vec = Common::FS::SplitPathComponents(path); | 237 | auto vec = Common::FS::SplitPathComponents(path); |
| 240 | vec.erase(std::remove_if(vec.begin(), vec.end(), [](const auto& str) { return str.empty(); }), | ||
| 241 | vec.end()); | ||
| 242 | if (vec.empty()) { | 238 | if (vec.empty()) { |
| 243 | // TODO(DarkLordZach): Return this directory if path is '/' or similar. Can't currently | 239 | // TODO(DarkLordZach): Return this directory if path is '/' or similar. Can't currently |
| 244 | // because of const-ness | 240 | // because of const-ness |
| @@ -303,8 +299,6 @@ std::size_t VfsDirectory::GetSize() const { | |||
| 303 | 299 | ||
| 304 | VirtualFile VfsDirectory::CreateFileRelative(std::string_view path) { | 300 | VirtualFile VfsDirectory::CreateFileRelative(std::string_view path) { |
| 305 | auto vec = Common::FS::SplitPathComponents(path); | 301 | auto vec = Common::FS::SplitPathComponents(path); |
| 306 | vec.erase(std::remove_if(vec.begin(), vec.end(), [](const auto& str) { return str.empty(); }), | ||
| 307 | vec.end()); | ||
| 308 | if (vec.empty()) { | 302 | if (vec.empty()) { |
| 309 | return nullptr; | 303 | return nullptr; |
| 310 | } | 304 | } |
| @@ -334,8 +328,6 @@ VirtualFile VfsDirectory::CreateFileAbsolute(std::string_view path) { | |||
| 334 | 328 | ||
| 335 | VirtualDir VfsDirectory::CreateDirectoryRelative(std::string_view path) { | 329 | VirtualDir VfsDirectory::CreateDirectoryRelative(std::string_view path) { |
| 336 | auto vec = Common::FS::SplitPathComponents(path); | 330 | auto vec = Common::FS::SplitPathComponents(path); |
| 337 | vec.erase(std::remove_if(vec.begin(), vec.end(), [](const auto& str) { return str.empty(); }), | ||
| 338 | vec.end()); | ||
| 339 | if (vec.empty()) { | 331 | if (vec.empty()) { |
| 340 | return nullptr; | 332 | return nullptr; |
| 341 | } | 333 | } |