Actually, this is just a standard switch statement,-- not Duff's device.
On the clarity argument, it's very much in the eye of the beholder whether your if cascade (or the and cascade) is clearer than the computed-goto version?
For completeness, the computed goto version works out an average of over 60% faster than either of the cascade versions, which is rather more than a few dozen clock cycles.
In reply to Re^2: fall through switch/case in perl
by BrowserUk
in thread fall through switch/case in perl
by ykar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |