Skip to content

Commit 9523062

Browse files
[BOLT] Use llvm::max_element (NFC) (#140342)
1 parent 7b8bc1b commit 9523062

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

bolt/lib/Passes/PettisAndHansen.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,10 @@ std::vector<Cluster> pettisAndHansen(const CallGraph &Cg) {
143143
// Find an arc with max weight and merge its nodes
144144

145145
while (!Carcs.empty()) {
146-
auto Maxpos =
147-
std::max_element(Carcs.begin(), Carcs.end(),
148-
[&](const ClusterArc &Carc1, const ClusterArc &Carc2) {
149-
return Carc1.Weight < Carc2.Weight;
150-
});
146+
auto Maxpos = llvm::max_element(
147+
Carcs, [&](const ClusterArc &Carc1, const ClusterArc &Carc2) {
148+
return Carc1.Weight < Carc2.Weight;
149+
});
151150

152151
ClusterArc Max = *Maxpos;
153152
Carcs.erase(Maxpos);

0 commit comments

Comments
 (0)