~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/index.py

Remove performance overhead of set intersection against dicts in index iteraction.

Show diffs side-by-side

added added

removed removed

Lines of Context:
255
255
                self._nodes[key] = (value, tuple(node_refs))
256
256
            else:
257
257
                self._nodes[key] = value
 
258
        self._keys = set(self._nodes)
258
259
        if trailers != 1:
259
260
            # there must be one line - the empty trailer line.
260
261
            raise errors.BadIndexData(self)
302
303
            return
303
304
        if self._nodes is None:
304
305
            self._buffer_all()
305
 
        keys = keys.intersection(self._nodes)
 
306
        keys = keys.intersection(self._keys)
306
307
        if self.node_ref_lists:
307
308
            for key in keys:
308
309
                value, node_refs = self._nodes[key]