]> source.dussan.org Git - jgit.git/commit
SimilarityRenameDetector: Only attempt to index large files once 90/1890/2
authorShawn O. Pearce <spearce@spearce.org>
Thu, 11 Nov 2010 22:25:01 +0000 (14:25 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 12 Nov 2010 19:57:02 +0000 (11:57 -0800)
commit918e6e20f04350557579add806f0deb2a59ba837
tree6fa49f903cee9c1e309392b9e2a5ef78b5ceae8c
parent0e307a6afddbb564ea6c34b3766d749f80e4442a
SimilarityRenameDetector: Only attempt to index large files once

If a file fails to index the first time the loop encounters it, the
file is likely to fail to index again on the next row.  Rather than
wasting a huge amount of CPU to index it again and fail, remember
which destination files failed to index and skip over them on each
subsequent row.

Because this condition is very unlikely, avoid allocating the BitSet
until its actually needed.  This keeps the memory usage unaffected
for the common case.

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