GzippedFileReader: Fix index creation

This commit is contained in:
Connor McLaughlin authored and refractionpcsx2 committed 2022-05-22 16:13:12 +01:00
1 parent ea051c6d5f
commit b919719aeb
3 files changed
+23 -18

No files matched your search

+9 -4
View File
@@ -315,16 +315,21 @@ namespace StringUtil
std::string ReplaceAll(const std::string_view& subject, const std::string_view& search, const std::string_view& replacement)
{
std::string ret(subject);
if (!ret.empty())
ReplaceAll(&ret, search, replacement);
return ret;
}
void ReplaceAll(std::string* subject, const std::string_view& search, const std::string_view& replacement)
{
if (!subject->empty())
{
std::string::size_type start_pos = 0;
while ((start_pos = ret.find(search, start_pos)) != std::string::npos)
while ((start_pos = subject->find(search, start_pos)) != std::string::npos)
{
ret.replace(start_pos, search.length(), replacement);
subject->replace(start_pos, search.length(), replacement);
start_pos += replacement.length();
}
}
return ret;
}
bool ParseAssignmentString(const std::string_view& str, std::string_view* key, std::string_view* value)