~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/btree_index.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-31 04:20:50 UTC
  • mfrom: (4771.3.1 2.1-btree-no-padding)
  • Revision ID: pqm@pqm.ubuntu.com-20091031042050-avqp46clpe9fabzm
(jam) Don't pad single-node btree indexes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
411
411
            # Special case the first node as it may be prefixed
412
412
            node = row.spool.read(_PAGE_SIZE)
413
413
            result.write(node[reserved:])
414
 
            result.write("\x00" * (reserved - position))
 
414
            if len(node) == _PAGE_SIZE:
 
415
                result.write("\x00" * (reserved - position))
415
416
            position = 0 # Only the root row actually has an offset
416
417
            copied_len = osutils.pumpfile(row.spool, result)
417
418
            if copied_len != (row.nodes - 1) * _PAGE_SIZE: