On Feb 25, 2007, at 5:28 PM, Andy Dent wrote: > On 26/02/2007, at 1:18 AM, Charles Yeomans wrote: > >> for i as Integer = f.Count downTo 1 >> DeleteItem f.TrueItem(i) >> next > > Whilst the Count downto 1 idiom is faster for things like skimming > through arrays, in this case isn't it a bit unsafe if the size of the > directory changes through other means whilst you are deleting? > > How much slower is 1 to Count for directories?
Because you alter the count while you in the loop you have to go backwards to make sure you remove all items It's not speed related _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
