mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
minor performance tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38805 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3b02814665
commit
5cbc47a238
3 changed files with 6 additions and 7 deletions
|
@ -1971,12 +1971,15 @@ compare(id elem1, id elem2, void* context)
|
|||
if (size > 0)
|
||||
{
|
||||
NSUInteger count = [self count];
|
||||
GS_BEGINIDBUF(objects, count);
|
||||
|
||||
size += count*sizeof(void*);
|
||||
[self getObjects: objects];
|
||||
while (count-- > 0)
|
||||
{
|
||||
size += [[self objectAtIndex: count] sizeInBytesExcluding: exclude];
|
||||
size += [objects[count] sizeInBytesExcluding: exclude];
|
||||
}
|
||||
GS_ENDIDBUF();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
|
|
@ -1241,9 +1241,8 @@ compareIt(id o1, id o2, void* context)
|
|||
size += 3 * sizeof(void*) * count;
|
||||
if (count > 0)
|
||||
{
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
NSEnumerator *enumerator = [self keyEnumerator];
|
||||
NSObject *k;
|
||||
NSEnumerator *enumerator = [self keyEnumerator];
|
||||
NSObject *k;
|
||||
|
||||
while ((k = [enumerator nextObject]) != nil)
|
||||
{
|
||||
|
@ -1252,7 +1251,6 @@ compareIt(id o1, id o2, void* context)
|
|||
size += [k sizeInBytesExcluding: exclude];
|
||||
size += [o sizeInBytesExcluding: exclude];
|
||||
}
|
||||
[pool release];
|
||||
}
|
||||
}
|
||||
return size;
|
||||
|
|
|
@ -1010,7 +1010,6 @@ static Class NSMutableSet_concrete_class;
|
|||
size += 3 * sizeof(void*) * count;
|
||||
if (count > 0)
|
||||
{
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
NSEnumerator *enumerator = [self objectEnumerator];
|
||||
NSObject *o;
|
||||
|
||||
|
@ -1018,7 +1017,6 @@ static Class NSMutableSet_concrete_class;
|
|||
{
|
||||
size += [o sizeInBytesExcluding: exclude];
|
||||
}
|
||||
[pool release];
|
||||
}
|
||||
}
|
||||
return size;
|
||||
|
|
Loading…
Reference in a new issue