D
DoB
Hi,
Given the following declaration:
object[] a = new object[SOME_BIG_NUMBER];
which code is faster?
1.
foreach ( object o in a )
DoSomethingWith(o);
2.
int iSize = a.Length;
int i;
foreach ( i = 0; i < iSize; i++ )
DoSomethingWith(a);
And why?
Regards,
DoB
Given the following declaration:
object[] a = new object[SOME_BIG_NUMBER];
which code is faster?
1.
foreach ( object o in a )
DoSomethingWith(o);
2.
int iSize = a.Length;
int i;
foreach ( i = 0; i < iSize; i++ )
DoSomethingWith(a);
And why?
Regards,
DoB