Skip to content

Commit 015c9be

Browse files
author
David Berneda
committed
Minor refactoring
1 parent b6b87b1 commit 015c9be

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

TeeGenericTree.pas

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,8 @@ function TNode<T>.Add(const AData: T): TNode<T>;
143143
end;
144144

145145
procedure TNode<T>.Clear;
146-
var t : TInteger;
147146
begin
148-
for t:=0 to Count-1 do
149-
begin
150-
FItems[t].FParent:=nil;
151-
FItems[t].Free;
152-
end;
153-
147+
Delete(0,Count);
154148
FItems:=nil;
155149
end;
156150

@@ -196,12 +190,12 @@ function TNode<T>.Get(Index: TInteger): TNode<T>;
196190
function TNode<T>.GetIndex: TInteger;
197191
var t : Integer;
198192
begin
199-
result:=-1;
200-
201193
if FParent<>nil then
202194
for t:=0 to FParent.Count-1 do
203195
if FParent[t]=Self then
204196
Exit(t);
197+
198+
result:=-1;
205199
end;
206200

207201
function TNode<T>.GetLevel: TInteger;

0 commit comments

Comments
 (0)