1432
1432
Returns a list of names corresponding to the hit_indices param.
1434
indices_info = zip(self._index_names, self._indices)
1435
1434
if 'index' in debug.debug_flags:
1436
1435
mutter('CombinedGraphIndex reordering: currently %r, promoting %r',
1437
1436
indices_info, hit_indices)
1438
hit_indices_info = []
1440
unhit_indices_info = []
1441
for name, idx in indices_info:
1439
new_hit_indices = []
1442
for offset, (name, idx) in enumerate(zip(self._index_names,
1442
1444
if idx in hit_indices:
1443
info = hit_indices_info
1445
new_hit_indices.append(idx)
1444
1446
hit_names.append(name)
1447
if len(new_hit_indices) == len(hit_indices):
1448
# We've found all of the hit entries, everything else is
1450
unhit_names.extend(self._index_names[offset+1:])
1451
unhit_indices.extend(self._indices[offset+1:])
1446
info = unhit_indices_info
1447
info.append((name, idx))
1448
final_info = hit_indices_info + unhit_indices_info
1449
self._indices = [idx for (name, idx) in final_info]
1450
self._index_names = [name for (name, idx) in final_info]
1454
unhit_names.append(name)
1455
unhit_indices.append(idx)
1457
self._indices = new_hit_indices + unhit_indices
1458
self._index_names = hit_names + unhit_names
1451
1459
if 'index' in debug.debug_flags:
1452
1460
mutter('CombinedGraphIndex reordered: %r', self._indices)
1453
1461
return hit_names