[Lldb-commits] [PATCH] D72909: Make SymbolFileDWARF::ParseLineTable use std::sort instead of insertion sort

George Rimar via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 21 00:31:50 PST 2020


grimar added inline comments.


================
Comment at: lldb/source/Symbol/LineTable.cpp:27
+  LineTable::Entry::LessThanBinaryPredicate less_than_bp(this);
+  std::sort(sequences.begin(), sequences.end(), less_than_bp);
+  for (auto *sequence : sequences) {
----------------
I wonder if this have to be `std::stable_sort`?
For `std::sort` the order of equal elements is not guaranteed to be preserved.

nit: you could also probably use the `llvm::sort` (it would be a bit shorter):
`llvm::sort(sequences, less_than_bp);`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72909





More information about the lldb-commits mailing list