/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/btree_index.py

  • Committer: John Arbash Meinel
  • Date: 2008-11-25 18:29:54 UTC
  • mto: This revision was merged to the branch mainline in revision 3855.
  • Revision ID: john@arbash-meinel.com-20081125182954-1d0u8uli0jphejy9
Rather than skipping the difference_update entirely, just restrict it to the intersection keys.

Show diffs side-by-side

added added

removed removed

Lines of Context:
431
431
            efficient order for the index (keys iteration order in this case).
432
432
        """
433
433
        keys = set(keys)
 
434
        local_keys = keys.intersection(self._keys)
434
435
        if self.reference_lists:
435
 
            for key in keys.intersection(self._keys):
 
436
            for key in local_keys:
436
437
                node = self._nodes[key]
437
438
                yield self, key, node[1], node[0]
438
439
        else:
439
 
            for key in keys.intersection(self._keys):
 
440
            for key in local_keys:
440
441
                node = self._nodes[key]
441
442
                yield self, key, node[1]
442
 
        if not self._backing_indices:
443
 
            return
444
443
        # Find things that are in backing indices that have not been handled
445
444
        # yet.
446
 
        # It turns out this difference_update can be a significant portion of
447
 
        # time when branching from a stacked branch to a standalone one.
448
 
        keys.difference_update(self._keys)
 
445
        # Remove all of the keys that we found locally
 
446
        keys.difference_update(local_keys)
449
447
        for backing in self._backing_indices:
450
448
            if backing is None:
451
449
                continue