mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-02 15:51:54 +00:00
[TableGen] Restructure a loop to make it exit early instead of skipping a portion of the body based on what will also be the terminating condition. NFC
llvm-svn: 237511
This commit is contained in:
parent
ab56bae9c6
commit
f26873fcc2
@ -1113,12 +1113,13 @@ Init *TernOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const {
|
||||
|
||||
std::string::size_type found;
|
||||
std::string::size_type idx = 0;
|
||||
do {
|
||||
while (true) {
|
||||
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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user