mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
get rid of unnecessary comparison
This commit is contained in:
parent
3f57aea897
commit
727e167705
1 changed files with 1 additions and 5 deletions
|
@ -111,15 +111,11 @@
|
|||
|
||||
- (NSComparisonResult) compareIP: (NSString *) string
|
||||
{
|
||||
if ([self isEqualToString: string])
|
||||
return NSOrderedSame;
|
||||
|
||||
NSArray * selfSections = [self componentsSeparatedByString: @"."],
|
||||
* newSections = [string componentsSeparatedByString: @"."];
|
||||
|
||||
if ([selfSections count] != [newSections count])
|
||||
return [[NSNumber numberWithUnsignedInt: [selfSections count]] compare:
|
||||
[NSNumber numberWithUnsignedInt: [newSections count]]];
|
||||
return [selfSections count] > [newSections count] ? NSOrderedDescending : NSOrderedAscending;
|
||||
|
||||
NSEnumerator * selfSectionsEnum = [selfSections objectEnumerator], * newSectionsEnum = [newSections objectEnumerator];
|
||||
NSString * selfString, * newString;
|
||||
|
|
Loading…
Reference in a new issue