From b8e1b6da770cfc10d1e505f1d4890ebe107bacce Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Sat, 8 Nov 2008 23:22:21 +0100 Subject: [PATCH] RevList: Optimize revision walking This is a naive approach at optimizing the revision walking. --- PBGitRevList.m | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/PBGitRevList.m b/PBGitRevList.m index 757312c..f29f752 100644 --- a/PBGitRevList.m +++ b/PBGitRevList.m @@ -117,7 +117,7 @@ [self performSelectorOnMainThread:@selector(setCommits:) withObject:revisions waitUntilDone:NO]; g = [[PBGitGrapher alloc] initWithRepository: repository]; revisions = [NSMutableArray array]; - currentLine = [NSMutableString string]; + [currentLine = setString: @""]; continue; } @@ -125,7 +125,7 @@ NSArray* components = [currentLine componentsSeparatedByString:@"\01"]; if ([components count] < 5) { NSLog(@"Can't split string: %@", currentLine); - currentLine = [NSMutableString string]; + [currentLine = setString: @""]; continue; } @@ -148,13 +148,11 @@ [self performSelectorOnMainThread:@selector(setCommits:) withObject:revisions waitUntilDone:NO]; - currentLine = [NSMutableString string]; + [currentLine = setString: @""]; } // Make sure the commits are stored before exiting. [self performSelectorOnMainThread:@selector(setCommits:) withObject:revisions waitUntilDone:YES]; - - [NSThread exit]; } @end