Hacker News new | past | comments | ask | show | jobs | submit login

Independent of undefined behavior: Who writes such god-awful code?

There:

    for (k=0; k < 16; k++)
    {
      dd = d[k];
      satd += (dd < 0 ? -dd : dd);
    }
Just one more line, less error-prone, idiomatic for-loop and variable accesses (therefore easier and faster to comprehend), and best of all: no undefined behavior.

("But if my code is simple, how will other people know what a genius I am?")

There's no way I would accept the code from that benchmark in a code review.




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

Search: