Does a more efficient way of populating ListBox with file names from TDirectory.GetFiles exist?
procedure PopListBox(var lb: TListBox; dir, ext: String; so: TSearchOption);
var
i: Integer;
iend: Integer;
oc: TStringDynArray;
begin
oc := TDirectory.GetFiles(dir, ext, so);
iend := Length(oc);
i := 0;
repeat
lb.Items.Add(oc[i]);
Inc(i);
until (i > (iend - 1));
end;
I would like input from the community on this approach.