~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_chunk_writer.py

  • Committer: John Arbash Meinel
  • Date: 2008-08-21 22:58:21 UTC
  • mto: This revision was merged to the branch mainline in revision 3644.
  • Revision ID: john@arbash-meinel.com-20080821225821-sio6j57zwk7kvqe2
Bringing reserved in as a keyword to write() also saves some time.
ChunkWriter.write() is called for every key, so having an extra redirection
The 
was a measurable loss. Also, a small tuneup for the compressor that
we access often. Unfortunately, there isn't much more tuning
that we can do in that function.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
        for line in lines:
82
82
            if writer.write(line):
83
83
                break
84
 
        self.assertFalse(writer.write_reserved("A"*256))
 
84
        self.assertFalse(writer.write("A"*256, reserved=True))
85
85
        bytes_list, unused, _ = writer.finish()
86
86
        node_bytes = self.check_chunk(bytes_list, 4096)
87
87
        # the first 44 lines should have been added