]> source.dussan.org Git - jgit.git/commit
Always allocate the PackOutputStream copyBuffer 80/11780/2
authorShawn Pearce <spearce@spearce.org>
Wed, 10 Apr 2013 16:33:56 +0000 (09:33 -0700)
committerShawn Pearce <spearce@spearce.org>
Wed, 10 Apr 2013 19:58:51 +0000 (12:58 -0700)
commit2be6927d8e707458e7efdfa4b585a3dd627c7346
treef2fed2859bca8bd408085d9844339c46f4b71c51
parenteb17495ca4ce95c63bacf81af16ab19ff042b65c
Always allocate the PackOutputStream copyBuffer

The getCopyBuffer() is almost always used during output. All known
implementations of ObjectReuseAsIs rely on the buffer to be present,
and the only sane way to get good performance from PackWriter is to
reuse objects during packing.

Avoid a branch and test when obtaining this buffer by making sure
it is always populated.

Change-Id: I200baa0bde5dcdd11bab7787291ad64535c9f7fb
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackOutputStream.java