Reduced redundant memory management in OOPriorityQueue.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4215 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2011-02-02 22:38:56 +00:00
parent 7ba3cce23a
commit a11ef65cd3

View File

@ -350,7 +350,8 @@ OOINLINE NSComparisonResult PQCompare(id a, id b, SEL comparator)
- (id) peekAtNextObject
{
if (_count == 0) return nil;
return [[_heap[0] retain] autorelease];
// return [[_heap[0] retain] autorelease];
return _heap[0];
}
@ -531,7 +532,7 @@ OOINLINE NSComparisonResult PQCompare(id a, id b, SEL comparator)
// Special case: removing last (or only) object. No bubbling needed.
}
[object release];
[object autorelease];
if (_count * 2 <= _capacity) [self shrinkBuffer];
}