Actually, as far as I know strings in .NEt has an exception for that. It overloads == operator and calls Object.Equal() method for comparisons. So it shouldnt compare the references but objects itself.
Anyway what I meant was actually crappy code vs speed. If you are doing a large amount of iterations, you could change it if it gets faster but otherwise it is not worth it since it compeletely loses its readibility..
__________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."
|