From: Shawn Pearce Date: Sun, 20 Apr 2014 01:24:43 +0000 (-0700) Subject: blame: Only use computeRange if -L was requested X-Git-Tag: v3.4.0.201405051725-m7~18^2~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4db7e8f94d3764e4ebdb51fb6f22b75d701bb248;p=jgit.git blame: Only use computeRange if -L was requested The computeRange method is inefficient for computing the entire file. If the entire file was selected ask for the entire file. Change-Id: I8b2dbf635e875cc125443dac50be121208646540 --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameResult.java b/org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameResult.java index 2d445fd7b2..faaa227b48 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameResult.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameResult.java @@ -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))