J
John Sparrow
if I say something like:
if (a != null && a.ToString() == "hello") { whatever }
is there any chance the CLR would optimize the code to evaluate the
second operand first, and hence potentially cause an access
violation??
I know many non-.NET languages will do this, the only way to guarantee
operand evaluation order is to say something like:
if (a != null) { if (a.ToString()) == "hello" { whatever } }
Thanks,
John
if (a != null && a.ToString() == "hello") { whatever }
is there any chance the CLR would optimize the code to evaluate the
second operand first, and hence potentially cause an access
violation??
I know many non-.NET languages will do this, the only way to guarantee
operand evaluation order is to say something like:
if (a != null) { if (a.ToString()) == "hello" { whatever } }
Thanks,
John