Skip to content

Commit 3fb3df3

Browse files
[ModuleInliner] Use SmallVector::pop_back_val (NFC)
We can use std::pop_heap first and then retrieve the top priority item with pop_back_val, saving one line of code.
1 parent 400389d commit 3fb3df3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Analysis/InlineOrder.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,10 @@ class PriorityInlineOrder : public InlineOrder<std::pair<CallBase *, int>> {
255255
assert(size() > 0);
256256
adjust();
257257

258-
CallBase *CB = Heap.front();
258+
std::pop_heap(Heap.begin(), Heap.end(), isLess);
259+
CallBase *CB = Heap.pop_back_val();
259260
T Result = std::make_pair(CB, InlineHistoryMap[CB]);
260261
InlineHistoryMap.erase(CB);
261-
std::pop_heap(Heap.begin(), Heap.end(), isLess);
262-
Heap.pop_back();
263262
return Result;
264263
}
265264

0 commit comments

Comments
 (0)