compare method

int compare(
  1. int x,
  2. int y
)

Implementation

int compare(int x, int y) {
  return x < y ? -1 : (x == y ? 0 : 1);
}