mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 05:21:25 +12:00
Replace std::string::npos with umax
This commit is contained in:
parent
0a41999818
commit
7a8772dafa
18 changed files with 42 additions and 42 deletions
|
@ -342,7 +342,7 @@ std::string fmt::replace_first(const std::string& src, const std::string& from,
|
|||
{
|
||||
auto pos = src.find(from);
|
||||
|
||||
if (pos == std::string::npos)
|
||||
if (pos == umax)
|
||||
{
|
||||
return src;
|
||||
}
|
||||
|
@ -353,7 +353,7 @@ std::string fmt::replace_first(const std::string& src, const std::string& from,
|
|||
std::string fmt::replace_all(const std::string& src, const std::string& from, const std::string& to)
|
||||
{
|
||||
std::string target = src;
|
||||
for (auto pos = target.find(from); pos != std::string::npos; pos = target.find(from, pos + 1))
|
||||
for (auto pos = target.find(from); pos != umax; pos = target.find(from, pos + 1))
|
||||
{
|
||||
target = (pos ? target.substr(0, pos) + to : to) + std::string(target.c_str() + pos + from.length());
|
||||
pos += to.length();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue