Skip to content

Commit 6aa2894

Browse files
committed
GitGrapher: Remove unneedded loop
I'm not sure what this loop originally did, but it was buggy and doesn't seem logical. Removing it speeds up the graphing a lot, so let's kill it. We can always get it back later if necessary
1 parent d2eafc2 commit 6aa2894

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

PBGitGrapher.mm

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -66,32 +66,9 @@ - (void) decorateCommit: (PBGitCommit *) commit
6666
}
6767
else {
6868
// We are not this commit.
69-
// Try to find an earlier column for this commit.
70-
int j = 0;
71-
BOOL found = NO;
72-
std::vector<PBGitLane *>::iterator it2 = currentLanes->begin();
73-
for (; it2 < currentLanes->end(); ++it2) {
74-
j++;
75-
// ??? what is this?
76-
// if (j == newPos)
77-
// continue;
78-
if ((*it)->isCommit([commit sha])) {
79-
// We already have a column for this commit. use it instead
80-
[lines addObject: [PBGitGraphLine upperLineFrom: i to: j color: (*it)->index()]];
81-
found = YES;
82-
break;
83-
}
84-
}
85-
86-
// We need a new column for this.
87-
if (found) {
88-
//NSLog(@"Need to delete");
89-
} else {
90-
//NSLog(@"Found another");
91-
currentLanes->push_back(*it);
92-
[lines addObject: [PBGitGraphLine upperLineFrom: i to: currentLanes->size() color: (*it)->index()]];
93-
[lines addObject: [PBGitGraphLine lowerLineFrom: currentLanes->size() to: currentLanes->size() color: (*it)->index()]];
94-
}
69+
currentLanes->push_back(*it);
70+
[lines addObject: [PBGitGraphLine upperLineFrom: i to: currentLanes->size() color: (*it)->index()]];
71+
[lines addObject: [PBGitGraphLine lowerLineFrom: currentLanes->size() to: currentLanes->size() color: (*it)->index()]];
9572
}
9673
// For existing columns, we always just continue straight down
9774
// ^^ I don't know what that means anymore :(

0 commit comments

Comments
 (0)