]> source.dussan.org Git - jgit.git/commitdiff
blame: Only use computeRange if -L was requested 08/25308/2
authorShawn Pearce <spearce@spearce.org>
Sun, 20 Apr 2014 01:24:43 +0000 (18:24 -0700)
committerShawn Pearce <spearce@spearce.org>
Mon, 21 Apr 2014 18:43:02 +0000 (11:43 -0700)
The computeRange method is inefficient for computing the entire file.
If the entire file was selected ask for the entire file.

Change-Id: I8b2dbf635e875cc125443dac50be121208646540

org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameResult.java

index 2d445fd7b25c474c1e80de0fe37b29568cdeeb10..faaa227b4867b50162c34e4c510834081ebfd22c 100644 (file)
@@ -290,6 +290,10 @@ public class BlameResult {
                BlameGenerator gen = generator;
                if (gen == null)
                        return;
+               if (start == 0 && end == resultContents.size()) {
+                       computeAll();
+                       return;
+               }
 
                while (start < end) {
                        if (hasSourceData(start, end))