ArrayList
Yep. ArrayList. If you are storing one type of object in ArrayList, why are you using it? You are wasting CPU cycles with boxing and unboxing. Include a reference to System.Collections and replace that snippet with a typed List.
ArrayList al = new ArrayList();
BecomesList<DateTime> typedList = new List<DateTime>();
Now your gains won't be huge like replacing String with StringBuilder, but not only will you gain performance, but you now don't have to worry about type checking, either.
Thanks for the Tip :)
ReplyDelete