mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-12-03 19:33:33 +01:00
GzippedFileReader: Fix index creation
This commit is contained in:
1 parent
ea051c6d5f
commit
b919719aeb
3 files changed
+23
-18
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user