mirror of
https://github.com/transmission/transmission
synced 2024-12-25 17:17:31 +00:00
trivial tweak to betterComponentsSeparatedByCharactersInSet:
This commit is contained in:
parent
246d6a72a3
commit
4ff20ab627
1 changed files with 11 additions and 13 deletions
|
@ -191,21 +191,19 @@
|
||||||
{
|
{
|
||||||
const NSRange range = [self rangeOfCharacterFromSet: separator options: 0 range: NSMakeRange(i, [self length]-i)];
|
const NSRange range = [self rangeOfCharacterFromSet: separator options: 0 range: NSMakeRange(i, [self length]-i)];
|
||||||
|
|
||||||
if (range.location != i)
|
if (range.location == NSNotFound)
|
||||||
{
|
{
|
||||||
if (range.location == NSNotFound)
|
[components addObject: [self substringFromIndex: i]];
|
||||||
{
|
break;
|
||||||
[components addObject: [self substringFromIndex: i]];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const NSUInteger length = range.location - i;
|
|
||||||
[components addObject: [self substringWithRange: NSMakeRange(i, length)]];
|
|
||||||
|
|
||||||
i += length;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else if (range.location != i)
|
||||||
|
{
|
||||||
|
const NSUInteger length = range.location - i;
|
||||||
|
[components addObject: [self substringWithRange: NSMakeRange(i, length)]];
|
||||||
|
|
||||||
|
i += length;
|
||||||
|
}
|
||||||
|
|
||||||
i += range.length;
|
i += range.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue