[PATCH] D78016: [ADT/STLExtras.h] - Add llvm::is_sorted wrapper and update callers.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 04:13:28 PDT 2020


grimar marked an inline comment as done.
grimar added inline comments.


================
Comment at: llvm/lib/IR/AsmWriter.cpp:231
 
-  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;
----------------
MaskRay wrote:
> This can be further simplified to `llvm::is_sorted(lll, llvm::less_second())`
I was not aware of `llvm::less_*()`, thanks!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78016/new/

https://reviews.llvm.org/D78016





More information about the llvm-commits mailing list