Skip to content

Commit

Permalink
format: fix replace_occurrences implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Olivier <martin.olivier@live.fr>
  • Loading branch information
martin-olivier committed Feb 12, 2025
1 parent 3bb57bb commit d045111
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
static void replace_occurrences(std::string &symbol, const std::string &find, const std::string &replace) {
size_t pos = 0;

while ((pos = symbol.find(find, pos)) != std::string::npos) {
while ((pos = symbol.find(find, pos)) != std::string::npos)
symbol.replace(pos, find.length(), replace);
pos += replace.length();
}
}

/************************ MSVC ************************/
Expand Down

0 comments on commit d045111

Please sign in to comment.