News for hackers. Stuff that matters.
Re:Clear is better than clever [pdf] by Vadoff on Monday May 06, 2019 @06:55PM (#19844763)
Couldn't you just break the ternary up?

  if a == b { return 0 }

  return a > b ? 1 : -1
Also it would be ~7 lines, not 10?

  if a > b {
    return 1
  } else if a < b {
    return -1
  } else {
    return 0
  }

There are no comments on this comment yet.