Merge pull request #2244 from lioncash/find

DolphinWX/Common: Change some find_first_of usages to find
This commit is contained in:
skidau 2015-03-30 21:07:42 +11:00
commit 008200db4d
3 changed files with 10 additions and 6 deletions

View File

@ -104,7 +104,7 @@ bool IniFile::Section::Get(const std::string& key, std::vector<std::string>* out
while (subStart != std::string::npos) while (subStart != std::string::npos)
{ {
// Find next , // Find next ,
size_t subEnd = temp.find_first_of(",", subStart); size_t subEnd = temp.find(',', subStart);
if (subStart != subEnd) if (subStart != subEnd)
// take from first char until next , // take from first char until next ,
out->push_back(StripSpaces(temp.substr(subStart, subEnd - subStart))); out->push_back(StripSpaces(temp.substr(subStart, subEnd - subStart)));

View File

@ -92,7 +92,7 @@ void LoadPatchSection(const std::string& section, std::vector<Patch>& patches, I
} }
else else
{ {
std::string::size_type loc = line.find_first_of('=', 0); std::string::size_type loc = line.find('=');
if (loc != std::string::npos) if (loc != std::string::npos)
{ {

View File

@ -767,8 +767,10 @@ void CISOProperties::OnExtractFile(wxCommandEvent& WXUNUSED (event))
if (OpenISO->IsWiiDisc()) if (OpenISO->IsWiiDisc())
{ {
int partitionNum = wxAtoi(File.Mid(File.find_first_of("/") - 1, 1)); size_t slash_index = File.find('/');
File.erase(0, File.find_first_of("/") + 1); // Remove "Partition x/" int partitionNum = wxAtoi(File.Mid(slash_index - 1, 1));
File.erase(0, slash_index + 1); // Remove "Partition x/"
WiiDisc.at(partitionNum).FileSystem->ExportFile(WxStrToStr(File), WxStrToStr(Path)); WiiDisc.at(partitionNum).FileSystem->ExportFile(WxStrToStr(File), WxStrToStr(Path));
} }
else else
@ -900,8 +902,10 @@ void CISOProperties::OnExtractDir(wxCommandEvent& event)
if (OpenISO->IsWiiDisc()) if (OpenISO->IsWiiDisc())
{ {
int partitionNum = wxAtoi(Directory.Mid(Directory.find_first_of("/") - 1, 1)); size_t slash_index = Directory.find('/');
Directory.erase(0, Directory.find_first_of("/") + 1); // Remove "Partition x/" int partitionNum = wxAtoi(Directory.Mid(slash_index - 1, 1));
Directory.erase(0, slash_index + 1); // Remove "Partition x/"
ExportDir(WxStrToStr(Directory), WxStrToStr(Path), partitionNum); ExportDir(WxStrToStr(Directory), WxStrToStr(Path), partitionNum);
} }
else else