[Lldb-commits] [lldb] r106192 - /lldb/trunk/source/Symbol/Symtab.cpp

Owen Anderson resistor at mac.com
Wed Jun 16 17:51:12 PDT 2010


Author: resistor
Date: Wed Jun 16 19:51:12 2010
New Revision: 106192

URL: http://llvm.org/viewvc/llvm-project?rev=106192&view=rev
Log:
Fix comment, per Chris' suggestion.

Modified:
    lldb/trunk/source/Symbol/Symtab.cpp

Modified: lldb/trunk/source/Symbol/Symtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=106192&r1=106191&r2=106192&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Symtab.cpp (original)
+++ lldb/trunk/source/Symbol/Symtab.cpp Wed Jun 16 19:51:12 2010
@@ -254,7 +254,10 @@
     if (indexes.size() <= 1)
         return;
 
-    // Sort the indexes in place using std::sort
+    // Sort the indexes in place using std::stable_sort.
+    // NOTE: The use of std::stable_sort instead of std::sort here is strictly for performance,
+    // not correctness.  The indexes vector tends to be "close" to sorted, which the
+    // stable sort handles better.
     std::stable_sort(indexes.begin(), indexes.end(), SymbolIndexComparator(m_symbols));
 
     // Remove any duplicates if requested





More information about the lldb-commits mailing list