summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-04-15 21:45:12 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-04-15 21:45:12 +0000
commitb57edcab3b5c6cfe408e8dee1d20b1ac9c41f9c0 (patch)
tree9a8056a99df254b4a1cd80889d97ac0161afb0e8
parent9c65e4d69cdc3f503119053c59bf0a5ca01e702e (diff)
downloadbcm5719-llvm-b57edcab3b5c6cfe408e8dee1d20b1ac9c41f9c0.tar.gz
bcm5719-llvm-b57edcab3b5c6cfe408e8dee1d20b1ac9c41f9c0.zip
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. llvm-svn: 129611
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
index 8f8179f5aab..89d0d4a90f2 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
@@ -320,12 +320,13 @@ DWARFDebugAranges::Sort()
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];
OpenPOWER on IntegriCloud