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

   return a < b ? -1 : a > b ? 1 : 0;
That's a nice approach. However the document is about Go, and Go doesn't have a ternary operator. So that probably leaves the switch solution as the clearest one.


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

Search: