Use getCachedBytes in IndexPack to avoid an unnecessary copy
commit4e4c88a8d291607e530973c9a55177da177f37ef
authorShawn O. Pearce <spearce@spearce.org>
Wed, 29 Apr 2009 18:54:43 +0000 (29 11:54 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Wed, 29 Apr 2009 23:49:07 +0000 (30 01:49 +0200)
tree7f8be7c046a18617a0b3beba183a56b9854096e4
parent27e4aa0be60e0f66ee4e4407f854f3c4ebf5c4bb
Use getCachedBytes in IndexPack to avoid an unnecessary copy

This is deep within the library code, where we know we won't overwrite
the cached buffer for an object.  Using getCachedBytes saves a full
array copy while fixing a thin pack and appending whole objects.  The
extra copy isn't so much an issue of CPU time as it is about creating
unnecessary temporary garbage for the GC to clean up.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit/src/org/spearce/jgit/transport/IndexPack.java