Only do one getCachedBytes per whole object written
commit7376dc867aec3a55f2e2882bb13f6a86bb6975b2
authorShawn O. Pearce <spearce@spearce.org>
Thu, 25 Dec 2008 02:11:13 +0000 (24 18:11 -0800)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Sun, 4 Jan 2009 00:06:08 +0000 (4 01:06 +0100)
treedae40415ca318d05e835fd9d3daabeb35abb5297
parent682240f47549f1c7952ae63331449478e8f66099
Only do one getCachedBytes per whole object written

Getting the size of an object may cause getCachedBytes to be invoked,
and then have its result discarded.  To save time we should make the
call to getCachedBytes first, hold onto the byte[], then obtain the
size off the byte[], and finally write from the byte[].

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/lib/PackWriter.java