From c4f3856b39958329c2f19341778c9ae6629d668a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20K=C3=BCgler?= Date: Sun, 18 May 2014 21:49:32 +0200 Subject: [PATCH] PlotCommitList: Remove handling of children that have no lane yet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Child commits always have a lane assigned when their parents are processed, so this code is no longer necessary. Children only assign themselves to parents in PlotCommitList.setupChildren(), which is called from enter(), when the child is processed. If the child leaves enter() it should always have a lane assigned. As a result of this, when processing a parent, all its known children already have lanes assigned. If the underlying RevWalk emits a parent before one of its children (which it should not do), the parent does not know of the child emitted later, because setupChildren() has not been called for the child yet. So even in this case, no child without a lane is encountered when processing a (parent) commit. Change-Id: I982adc5c114370ecfd699d96221a76463de900ca Signed-off-by: Konrad Kügler Signed-off-by: Matthias Sohn --- .../org/eclipse/jgit/revplot/PlotCommitList.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java index 9686e4568..9cbd94e26 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java @@ -130,11 +130,6 @@ public class PlotCommitList extends // Stay in the same lane as the child. // final PlotCommit c = currCommit.children[0]; - if (c.lane == null) { - // Hmmph. This child must be the first along this lane. - // - c.lane = nextFreeLane(); - } for (int r = index - 1; r >= 0; r--) { final PlotCommit rObj = get(r); if (rObj == c) @@ -169,15 +164,7 @@ public class PlotCommitList extends for (int i = 0; i < nChildren; i++) { final PlotCommit c = currCommit.children[i]; - // don't forget to position all of your children if they are - // not already positioned. - if (c.lane == null) { - c.lane = nextFreeLane(); - if (reservedLane != null) - closeLane(c.lane); - else - reservedLane = c.lane; - } else if (reservedLane == null && activeLanes.contains(c.lane)) + if (reservedLane == null && activeLanes.contains(c.lane)) reservedLane = c.lane; else closeLane(c.lane);