3 ms·
I don't know if this solves all the associated problems. If part of the chain of operations isn't side-effect-free, eg. function call, you'll still have to chec
by stormbrew 12y ago
I don't know if this solves all the associated problems. If part of the chain of operations isn't side-effect-free, eg. function call, you'll still have to check more than once for the whole chain. And if you want to do more than throw an error/exception you may need to re-run the operations on a slow path to get the correct result.
But I like it a lot even so. For a general case it seems like it would help.
- xxs 12y agoThe branch is to be predicted (close to perfectly) by the hardware so the branch cost would be like an extra cycle.