Question : Which is Better, FreeAndNil(SL) or SL.Clear?

Hi, I'm using TStringLists over and over again, which is better, safer and faster?

to Use the Firstly Created SL over and over again by filling and clearing?

or totally recreating the SL filling and then FreeAndNil?

Answer : Which is Better, FreeAndNil(SL) or SL.Clear?

if it's for 1 thread only program
i think there will not be very much difference

for multiple thread, if you have synchronized access to the 1 stringlist, ok

all depends on what you want to store in it
and how much
Random Solutions  
 
programming4us programming4us