Is converting this ArrayList to a Generic List efficient?
Posted
by Greg
on Stack Overflow
See other posts from Stack Overflow
or by Greg
Published on 2010-06-07T18:19:11Z
Indexed on
2010/06/07
18:22 UTC
Read the original article
Hit count: 238
The code I'm writing receives an ArrayList from unmanaged code, and this ArrayList will always contain one or more objects of type Grid_Heading_Blk. I've considered changing this ArrayList to a generic List, but I'm unsure if the conversion operation will be so expensive as to nullify the benefits of working with the generic list. Currently, I'm just running a foreach (Grid_Heading_Blk in myArrayList)
operation to work with the ArrayList contents after passing the ArrayList to the class that will use it.
Should I convert the ArrayList to a generic typed list? And if so, what is the most efficient way of doing so?
© Stack Overflow or respective owner