Is there an optimization advantage in doing as shown in test2() below
posted 10 years ago
I posted this in the beginner forum, so sorry for the cross post, not really sure where it fits...
Is there any advantage from a performance standpoint in declaring an object outside of an interation loop before you go through and assign it references as the condition iterates (even if the collection is very large)? I would think there would be no performance advantage between test1 and test2 below but I want to be certain.