mirror of
https://github.com/transmission/transmission
synced 2025-02-21 05:36:54 +00:00
even more work on betterComponentsSeparatedByCharactersInSet:
This commit is contained in:
parent
e0278e8d52
commit
3362a73a22
1 changed files with 10 additions and 8 deletions
|
@ -193,16 +193,18 @@
|
|||
|
||||
if (range.location != i)
|
||||
{
|
||||
NSUInteger length;
|
||||
if (range.location == NSNotFound)
|
||||
length = [self length] - i;
|
||||
else
|
||||
length = range.location - i;
|
||||
[components addObject: [self substringWithRange: NSMakeRange(i, length)]];
|
||||
|
||||
if (range.location == NSNotFound)
|
||||
{
|
||||
[components addObject: [self substringFromIndex: i]];
|
||||
break;
|
||||
i += length;
|
||||
}
|
||||
else
|
||||
{
|
||||
const NSUInteger length = range.location - i;
|
||||
[components addObject: [self substringWithRange: NSMakeRange(i, length)]];
|
||||
|
||||
i += length;
|
||||
}
|
||||
}
|
||||
i += range.length;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue