mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Rewrite last change to be a little more efficient
This commit is contained in:
parent
f3344628e5
commit
f1b3144209
1 changed files with 7 additions and 7 deletions
|
@ -1341,18 +1341,18 @@ GSICUStringMatchesRegex(NSString *string, NSString *regex, NSStringCompareOption
|
|||
{
|
||||
if ([_obj isKindOfClass: [NSArray class]])
|
||||
{
|
||||
NSMutableArray *tmp = [(NSArray*)_obj mutableCopy];
|
||||
NSUInteger count = [tmp count];
|
||||
NSUInteger index;
|
||||
NSUInteger count = [(NSArray*)_obj count];
|
||||
NSMutableArray *tmp = [NSMutableArray arrayWithCapacity: count];
|
||||
NSUInteger index = 0;
|
||||
|
||||
for (index = 0; index < count; index++)
|
||||
while (index < count)
|
||||
{
|
||||
NSExpression *e = [tmp objectAtIndex: index];
|
||||
NSExpression *e = [(NSArray*)_obj objectAtIndex: index++];
|
||||
id o = [e expressionValueWithObject: e context: context];
|
||||
|
||||
[tmp replaceObjectAtIndex: index withObject: o];
|
||||
[tmp addObject: o];
|
||||
}
|
||||
return AUTORELEASE(tmp);
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue