Today I stumbled across something similar to the following chunk of c# code.
19 private static void DoStuff(object o) 20 { 21 // Do Some Work... 22 object newObject = CheckObject(o); 23 // More Work... 24 } 25 26 private static object CheckObject(object param) 27 { 28 if (!(param == null)) 29 return param; 30 else 31 return null; 32 }
There is something wrong hereā¦
Interestingly the .net 1.1 c# compiler does not automatically optimize this code, I wonder why?
Disclaimer: Points cannot be exchanged for cash. Points have no material value and are actually worthless.