~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/btree_index.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-05 11:31:58 UTC
  • mto: This revision was merged to the branch mainline in revision 5757.
  • Revision ID: jelmer@samba.org-20110405113158-jyxg63dywvs843vy
Review feedback from John.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
from bzrlib.lazy_import import lazy_import
23
23
lazy_import(globals(), """
24
 
from bisect import bisect_right
 
24
import bisect
25
25
import math
26
26
import tempfile
27
27
import zlib
1051
1051
        # iter_steps = len(in_keys) + len(fixed_keys)
1052
1052
        # bisect_steps = len(in_keys) * math.log(len(fixed_keys), 2)
1053
1053
        if len(in_keys) == 1: # Bisect will always be faster for M = 1
1054
 
            return [(bisect_right(fixed_keys, in_keys[0]), in_keys)]
 
1054
            return [(bisect.bisect_right(fixed_keys, in_keys[0]), in_keys)]
1055
1055
        # elif bisect_steps < iter_steps:
1056
1056
        #     offsets = {}
1057
1057
        #     for key in in_keys: