mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 13:39:11 +02:00
avglvltree: setcompare: set when count=0
git-svn-id: trunk@38486 -
This commit is contained in:
parent
75c516c1ea
commit
30aefa3503
@ -1577,8 +1577,12 @@ var List: PPointer;
|
|||||||
i, OldCount: integer;
|
i, OldCount: integer;
|
||||||
begin
|
begin
|
||||||
if (FOnCompare=NewCompare) and (FOnObjectCompare=NewObjectCompare) then exit;
|
if (FOnCompare=NewCompare) and (FOnObjectCompare=NewObjectCompare) then exit;
|
||||||
|
if Count<1 then begin
|
||||||
|
FOnCompare:=NewCompare;
|
||||||
|
FOnObjectCompare:=NewObjectCompare;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
// sort the tree again
|
// sort the tree again
|
||||||
if Count>0 then begin
|
|
||||||
OldCount:=Count;
|
OldCount:=Count;
|
||||||
GetMem(List,SizeOf(Pointer)*OldCount);
|
GetMem(List,SizeOf(Pointer)*OldCount);
|
||||||
try
|
try
|
||||||
@ -1602,7 +1606,6 @@ begin
|
|||||||
FreeMem(List);
|
FreeMem(List);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TAvgLvlTree.RotateLeft(aNode: TAvgLvlTreeNode);
|
procedure TAvgLvlTree.RotateLeft(aNode: TAvgLvlTreeNode);
|
||||||
{ Parent Parent
|
{ Parent Parent
|
||||||
|
Loading…
Reference in New Issue
Block a user