Which is faster?  For arrays, do both castclass and isinst have to walk the list of 
elements, checking each one?

I find I never know when to write

    string[] foo =
    (string[])arraylist.ToArray(typeof(string)); // castclass
vs
    string[] foo =
    arraylist.ToArray(typeof(string)) as string[]; // isinst

The latter is easer to type (fewer parens ;-) but seems to give fits to VS's 
intellisense and auto-formatting features.  :-(

Cheers,
-Shawn
http://www.arithex.com/

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to