Skip to content

Commit

Permalink
Fixed issue todotxt#114 - Context & Project choices should be case-in…
Browse files Browse the repository at this point in the history
…sensitive
  • Loading branch information
marsepu committed Jul 7, 2012
1 parent 61f0971 commit d2c10de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 5 additions & 3 deletions Classes/ContextParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ + (NSArray*) parse:(NSString*)inputText {
options:0
range:NSMakeRange(0, [inputText length])];

NSMutableArray* contexts = [NSMutableArray arrayWithCapacity:[contextMatches count]];
NSMutableSet* contexts = [NSMutableSet setWithCapacity:[contextMatches count]];
for (NSTextCheckingResult *match in contextMatches) {
[contexts addObject:[inputText substringWithRange:[match rangeAtIndex:1]]];
NSString *theContextInLowercase = [[inputText substringWithRange:[match rangeAtIndex:1]] lowercaseString];

[contexts addObject:theContextInLowercase];
}

return contexts;
return [contexts allObjects];
}


Expand Down
7 changes: 4 additions & 3 deletions Classes/ProjectParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ + (NSArray*) parse:(NSString*)inputText {
options:0
range:NSMakeRange(0, [inputText length])];

NSMutableArray* projects = [NSMutableArray arrayWithCapacity:[projectMatches count]];
NSMutableSet* projects = [NSMutableSet setWithCapacity:[projectMatches count]];
for (NSTextCheckingResult *match in projectMatches) {
[projects addObject:[inputText substringWithRange:[match rangeAtIndex:1]]];
NSString* theProjectInLowercase = [[inputText substringWithRange:[match rangeAtIndex:1]] lowercaseString];
[projects addObject:theProjectInLowercase];
}

return projects;
return [projects allObjects];
}


Expand Down

0 comments on commit d2c10de

Please sign in to comment.