Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I assume that what the OP meant by Duff's Device is "switch in C is syntactically a goto" rather than the specific loop-unrolling paradigm of Duff's Device itself. An example usage I've come across is the bzip2 decompressor: https://github.com/enthought/bzip2-1.0.6/blob/288acf97a15d55...

(note that the case statements are hidden in all of the GET_* macro calls).



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: