avglvltree: setcompare: set when count=0

git-svn-id: trunk@38486 -
This commit is contained in:
mattias 2012-09-02 15:57:47 +00:00
parent 75c516c1ea
commit 30aefa3503

View File

@ -1577,8 +1577,12 @@ var List: PPointer;
i, OldCount: integer;
begin
if (FOnCompare=NewCompare) and (FOnObjectCompare=NewObjectCompare) then exit;
if Count<1 then begin
FOnCompare:=NewCompare;
FOnObjectCompare:=NewObjectCompare;
exit;
end;
// sort the tree again
if Count>0 then begin
OldCount:=Count;
GetMem(List,SizeOf(Pointer)*OldCount);
try
@ -1601,7 +1605,6 @@ begin
finally
FreeMem(List);
end;
end;
end;
procedure TAvgLvlTree.RotateLeft(aNode: TAvgLvlTreeNode);