mirror of
https://github.com/transmission/transmission
synced 2025-02-22 14:10:34 +00:00
improvements to betterComponentsSeparatedByCharactersInSet:
This commit is contained in:
parent
aead1caae1
commit
e0278e8d52
1 changed files with 4 additions and 2 deletions
|
@ -186,7 +186,8 @@
|
||||||
{
|
{
|
||||||
NSMutableArray * components = [NSMutableArray array];
|
NSMutableArray * components = [NSMutableArray array];
|
||||||
|
|
||||||
for (NSUInteger i = 0; i < [self length];)
|
NSUInteger i = 0;
|
||||||
|
while (i < [self length])
|
||||||
{
|
{
|
||||||
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)];
|
||||||
|
|
||||||
|
@ -201,8 +202,9 @@
|
||||||
|
|
||||||
if (range.location == NSNotFound)
|
if (range.location == NSNotFound)
|
||||||
break;
|
break;
|
||||||
i += length + range.length;
|
i += length;
|
||||||
}
|
}
|
||||||
|
i += range.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
return components;
|
return components;
|
||||||
|
|
Loading…
Reference in a new issue