I want to remove duplicate elements from a large TListBox. For this, I use the classic simple method. It works, but it takes 19 minutes. I read a lot and apparently should use TFileStream (?). But I dont know how.
My classic method is this:
procedure NoDup(AListBox : TListBox); var i : integer; begin with AListBox do for i := Items.Count - 1 downto 0 do begin if Items.IndexOf(Items[i]) < i then Items.Delete(i); Application.ProcessMessages; end; end;
How can I improve speed?
source share