diff options
| author | Kazu Hirata <kazu@google.com> | 2023-10-18 13:04:45 -0700 |
|---|---|---|
| committer | Kazu Hirata <kazu@google.com> | 2023-10-18 13:04:46 -0700 |
| commit | 3fb3df36eaeecaea59de42e3d3f4eec79c3aac4e (patch) | |
| tree | 0f52f29c158d2a2e21ee8b707e16ad83907fd4e3 /llvm/lib/Analysis/InlineOrder.cpp | |
| parent | 400389db7de3aac4cd56c95789014aa9206e376b (diff) | |
[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.
Diffstat (limited to 'llvm/lib/Analysis/InlineOrder.cpp')
| -rw-r--r-- | llvm/lib/Analysis/InlineOrder.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/InlineOrder.cpp b/llvm/lib/Analysis/InlineOrder.cpp index b086ac15a207..1bdb3b98bc87 100644 --- a/llvm/lib/Analysis/InlineOrder.cpp +++ b/llvm/lib/Analysis/InlineOrder.cpp @@ -255,11 +255,10 @@ public: assert(size() > 0); adjust(); - CallBase *CB = Heap.front(); + std::pop_heap(Heap.begin(), Heap.end(), isLess); + CallBase *CB = Heap.pop_back_val(); T Result = std::make_pair(CB, InlineHistoryMap[CB]); InlineHistoryMap.erase(CB); - std::pop_heap(Heap.begin(), Heap.end(), isLess); - Heap.pop_back(); return Result; } |
