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:
parent
7ba3cce23a
commit
a11ef65cd3
@ -350,7 +350,8 @@ OOINLINE NSComparisonResult PQCompare(id a, id b, SEL comparator)
|
|||||||
- (id) peekAtNextObject
|
- (id) peekAtNextObject
|
||||||
{
|
{
|
||||||
if (_count == 0) return nil;
|
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.
|
// Special case: removing last (or only) object. No bubbling needed.
|
||||||
}
|
}
|
||||||
|
|
||||||
[object release];
|
[object autorelease];
|
||||||
if (_count * 2 <= _capacity) [self shrinkBuffer];
|
if (_count * 2 <= _capacity) [self shrinkBuffer];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user