[ADT/STLExtras.h] - Add llvm::is_sorted wrapper and update callers.
It can be used to avoid passing the begin and end of a range. This makes the code shorter and it is consistent with another wrappers we already have. Differential revision: https://reviews.llvm.org/D78016
This commit is contained in:
@@ -231,9 +231,9 @@ static void predictValueUseListOrderImpl(const Value *V, const Function *F,
|
||||
return LU->getOperandNo() > RU->getOperandNo();
|
||||
});
|
||||
|
||||
if (std::is_sorted(
|
||||
List.begin(), List.end(),
|
||||
[](const Entry &L, const Entry &R) { return L.second < R.second; }))
|
||||
if (llvm::is_sorted(List, [](const Entry &L, const Entry &R) {
|
||||
return L.second < R.second;
|
||||
}))
|
||||
// Order is already correct.
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user