]> source.dussan.org Git - jgit.git/commit
PacketLineIn: Reuse internal lineBuffer for small strings 49/2749/2
authorShawn O. Pearce <spearce@spearce.org>
Thu, 17 Mar 2011 04:33:25 +0000 (21:33 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 17 Mar 2011 17:48:05 +0000 (10:48 -0700)
commit00a50401478171b900b5f1ea16c43618293706ce
treea620fb887b25b9a8b59dcbbf4001576c35f75094
parent5aab335f45760dce16350d10c8788f204a032206
PacketLineIn: Reuse internal lineBuffer for small strings

Most "ACK %s continue", "ACK %s common", "NAK" strings that are read
by the readACK() method and readString() are shorter than the
lineBuffer already available.  Reuse that buffer when reading from
the network stream and converting to a string with RawParseUtils to
avoid unnecessary temporary byte array allocations.

Change-Id: Ibc778d9f7721943a065041d80fc427ea50d90fff
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java