forked from OSchip/llvm-project
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
This commit is contained in:
parent
9c65e4d69c
commit
b57edcab3b
|
@ -320,12 +320,13 @@ DWARFDebugAranges::Sort()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Remove the merged ranges by shifting down all the keepers...
|
// 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();
|
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;
|
++src;
|
||||||
|
++i;
|
||||||
|
}
|
||||||
if (src == dst)
|
if (src == dst)
|
||||||
continue;
|
continue;
|
||||||
m_aranges[dst] = m_aranges[src];
|
m_aranges[dst] = m_aranges[src];
|
||||||
|
|
Loading…
Reference in New Issue