git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237511
91177308-0d34-0410-b5e6-
96231b3b80d8
std::string::size_type found;
std::string::size_type idx = 0;
std::string::size_type found;
std::string::size_type idx = 0;
found = Val.find(LHSs->getValue(), idx);
found = Val.find(LHSs->getValue(), idx);
- if (found != std::string::npos)
- Val.replace(found, LHSs->getValue().size(), MHSs->getValue());
- idx = found + MHSs->getValue().size();
- } while (found != std::string::npos);
+ if (found == std::string::npos)
+ break;
+ Val.replace(found, LHSs->getValue().size(), MHSs->getValue());
+ idx = found + MHSs->getValue().size();
+ }
return StringInit::get(Val);
}
return StringInit::get(Val);
}