Try-Catch or Check Length? C# XNA
Posted
by Shaded
on Stack Overflow
See other posts from Stack Overflow
or by Shaded
Published on 2010-03-18T14:20:34Z
Indexed on
2010/03/18
14:31 UTC
Read the original article
Hit count: 366
I was just wondering which would be cheaper, using a try catch block for index out of bounds or checking the length of a multi dimensional array and comparing values?
I have a feeling it's the length, since I can store the length in a variable and then just do if's which are relatively cheap. I'm just not sure how expensive try-catch is.
Thanks!
© Stack Overflow or respective owner