diff options
| author | Leo Lam <leolino.lam@gmail.com> | 2017-07-19 21:52:13 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-19 21:52:13 +0800 |
| commit | baf950c4179e32f36f8b617be16bfa96b2a38fef (patch) | |
| tree | 5ba37c5bb4cb1c0694187c790df767da04f81004 /Source/Core/DiscIO/FileSystemGCWii.cpp | |
| parent | 5461cf211d23e71da45613c5e075dbddfdbe5955 (diff) | |
| parent | c64d668c3c3a9561965554663b339fe8549f244d (diff) | |
Merge pull request #5796 from JosJuice/findfileinfo-find
Use find_first_not_of in FileSystemGCWii::FindFileInfo
Diffstat (limited to 'Source/Core/DiscIO/FileSystemGCWii.cpp')
| -rw-r--r-- | Source/Core/DiscIO/FileSystemGCWii.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Source/Core/DiscIO/FileSystemGCWii.cpp b/Source/Core/DiscIO/FileSystemGCWii.cpp index fca68113ba..9a7e24c288 100644 --- a/Source/Core/DiscIO/FileSystemGCWii.cpp +++ b/Source/Core/DiscIO/FileSystemGCWii.cpp @@ -270,11 +270,8 @@ std::unique_ptr<FileInfo> FileSystemGCWii::FindFileInfo(const std::string& path, // Given a path like "directory1/directory2/fileA.bin", this function will // find directory1 and then call itself to search for "directory2/fileA.bin". - size_t name_start = 0; - while (name_start < path.size() && path[name_start] == '/') - ++name_start; - - if (name_start == path.size()) + const size_t name_start = path.find_first_not_of('/'); + if (name_start == std::string::npos) return file_info.clone(); // We're done const size_t name_end = path.find('/', name_start); |
