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

I agree, but would go with:

    return a < b ? -1 : a > b;
This does the right thing, but removes the nested tertiary which to me is a big win.



What language? Those are different types.


I assumed C, and both values are of type int so they match.




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

Search: