~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/btree_index.py

  • Committer: John Arbash Meinel
  • Date: 2009-09-22 02:18:24 UTC
  • mto: This revision was merged to the branch mainline in revision 4709.
  • Revision ID: john@arbash-meinel.com-20090922021824-j3en52uqoof7ym89
Remove some assert statements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
    def finish_node(self, pad=True):
68
68
        byte_lines, _, padding = self.writer.finish()
69
69
        if self.nodes == 0:
70
 
            assert self.spool is None
71
70
            self.spool = cStringIO.StringIO()
72
71
            # padded note:
73
72
            self.spool.write("\x00" * _RESERVED_HEADER_BYTES)
74
73
        elif self.nodes == 1:
75
74
            # We got bigger than 1 node, switch to a temp file
76
 
            assert self.spool is not None
77
75
            spool = tempfile.TemporaryFile(prefix='bzr-index-row-')
78
76
            spool.write(self.spool.getvalue())
79
77
            self.spool = spool
80
 
        else:
81
 
            assert self.spool is not None
82
78
        skipped_bytes = 0
83
79
        if not pad and padding:
84
80
            del byte_lines[-1]