Skip to content

Commit 595d8d4

Browse files
committed
[TableGen] Make use of find_if. NFC.
1 parent b5046a7 commit 595d8d4

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

llvm/utils/TableGen/CodeGenRegisters.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,13 +1898,8 @@ void CodeGenRegBank::computeRegUnitWeights() {
18981898
static std::vector<RegUnitSet>::const_iterator
18991899
findRegUnitSet(const std::vector<RegUnitSet> &UniqueSets,
19001900
const RegUnitSet &Set) {
1901-
std::vector<RegUnitSet>::const_iterator I = UniqueSets.begin(),
1902-
E = UniqueSets.end();
1903-
for (; I != E; ++I) {
1904-
if (I->Units == Set.Units)
1905-
break;
1906-
}
1907-
return I;
1901+
return find_if(UniqueSets,
1902+
[&Set](const RegUnitSet &I) { return I.Units == Set.Units; });
19081903
}
19091904

19101905
// Return true if the RUSubSet is a subset of RUSuperSet.

0 commit comments

Comments
 (0)