Use find_first_not_of in FileSystemGCWii::FindFileInfo
This commit is contained in:
parent
ba356f78d1
commit
c64d668c3c
|
@ -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
|
// Given a path like "directory1/directory2/fileA.bin", this function will
|
||||||
// find directory1 and then call itself to search for "directory2/fileA.bin".
|
// find directory1 and then call itself to search for "directory2/fileA.bin".
|
||||||
|
|
||||||
size_t name_start = 0;
|
const size_t name_start = path.find_first_not_of('/');
|
||||||
while (name_start < path.size() && path[name_start] == '/')
|
if (name_start == std::string::npos)
|
||||||
++name_start;
|
|
||||||
|
|
||||||
if (name_start == path.size())
|
|
||||||
return file_info.clone(); // We're done
|
return file_info.clone(); // We're done
|
||||||
|
|
||||||
const size_t name_end = path.find('/', name_start);
|
const size_t name_end = path.find('/', name_start);
|
||||||
|
|
Loading…
Reference in New Issue