mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-26 10:09:51 +02:00
TreeFilterEdit: minor optimization
git-svn-id: trunk@34532 -
This commit is contained in:
parent
d6f03b7132
commit
f1899978ae
@ -402,23 +402,21 @@ end;
|
|||||||
function TTreeFilterEdit.GetBranch(ARootNode: TTreeNode): TBranch;
|
function TTreeFilterEdit.GetBranch(ARootNode: TTreeNode): TBranch;
|
||||||
// Get a new or existing branch for a node.
|
// Get a new or existing branch for a node.
|
||||||
var
|
var
|
||||||
branch: TBranch;
|
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
if not Assigned(fBranches) then
|
if not Assigned(fBranches) then
|
||||||
fBranches := TBranchList.Create;
|
fBranches := TBranchList.Create;
|
||||||
branch := Nil;
|
Result := Nil;
|
||||||
for i := 0 to fBranches.Count-1 do
|
for i := 0 to fBranches.Count-1 do
|
||||||
if fBranches[i].fRootNode = ARootNode then begin
|
if fBranches[i].fRootNode = ARootNode then begin
|
||||||
branch := fBranches[i];
|
Result := fBranches[i];
|
||||||
branch.fOriginalData.Clear;
|
Result.fOriginalData.Clear;
|
||||||
Break;
|
Break;
|
||||||
end;
|
end;
|
||||||
if branch = Nil then begin
|
if Result = Nil then begin
|
||||||
branch := TBranch.Create(Self, ARootNode);
|
Result := TBranch.Create(Self, ARootNode);
|
||||||
fBranches.Add(branch);
|
fBranches.Add(Result);
|
||||||
end;
|
end;
|
||||||
Result := branch;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTreeFilterEdit.MoveNext;
|
procedure TTreeFilterEdit.MoveNext;
|
||||||
|
Loading…
Reference in New Issue
Block a user