]> source.dussan.org Git - jgit.git/commit
Remove duplicated code in DiffFormatter 84/1484/1
authorShawn O. Pearce <spearce@spearce.org>
Wed, 1 Sep 2010 01:40:10 +0000 (18:40 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 1 Sep 2010 17:19:43 +0000 (10:19 -0700)
commit797d5c4d4080c132ff2d5272ea4d6cffc9c903ba
treef5a3f5e4427c75a5aa8124b4a5d5fdb09b188ed1
parent1ea356b3465974a955c0118725c9bafce657a0e6
Remove duplicated code in DiffFormatter

Instead of trying to stream out the header, we can drop a redundant
code path by formatting the header into a temporary buffer and then
streaming out the actual line differences later.

Its a small amount of unnecessary work to buffer the file header,
but these are typically very tiny so the cost to format and reparse
is relatively low.

Change-Id: Id14a527a74ee0bd7e07f46fdec760c22b02d5bdf
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java