Ya, they are definitely functionally equivalent, but the generated code is identical as well.
There are a lot of little C tricks that people use to coerce a given bit of assembly that while functionally equivalent to not using the trick is often more efficient (for whatever the given definition of efficient is).
I was kind of hoping that it was going to be some neat little trick where the generated assembly for the nested ifs was somehow more efficient, but (at least with the assembly that xcode with llvm spits out) it isn't. It's exactly the same.
View all comments
Show parent comment
5
u/[deleted] Oct 19 '09 edited Oct 19 '09
[removed] — view removed comment