[Lldb-commits] [lldb] r129611 - /lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp

Johnny Chen johnny.chen at apple.com
Fri Apr 15 14:45:12 PDT 2011


Author: johnny
Date: Fri Apr 15 16:45:12 2011
New Revision: 129611

URL: http://llvm.org/viewvc/llvm-project?rev=129611&view=rev
Log:
Get rid the of set membership test (log(m)) and, instead, use an index variable 'i'
which advances when src collides with a purged slot.
Hi Stephen, you're welcome to overwrite/or improve upon this version.  Thanks.

Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp?rev=129611&r1=129610&r2=129611&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp Fri Apr 15 16:45:12 2011
@@ -320,12 +320,13 @@
         return;
 
     // Remove the merged ranges by shifting down all the keepers...
-    std::set<size_t> purged(indices.begin(), indices.end());
     size_t new_size = m_aranges.size() - indices.size();
-    for (size_t src = 0, dst = 0; dst < new_size; ++src, ++dst)
+    for (size_t i = 0, src = 0, dst = 0; dst < new_size; ++src, ++dst)
     {
-        while (purged.count(src) > 0)
+        while (src == indices[i]) {
             ++src;
+            ++i;
+        }
         if (src == dst)
             continue;
         m_aranges[dst] = m_aranges[src];





More information about the lldb-commits mailing list