Skip to content

Commit

Permalink
[ARROW-5844][Java] Remove if conditons in default float & double comp…
Browse files Browse the repository at this point in the history
…arators
  • Loading branch information
liyafan82 committed Jul 10, 2019
1 parent a4b4099 commit a921cdd
Showing 1 changed file with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,7 @@ public int compareNotNull(int index1, int index2) {
}
}

float result = Math.signum(value1 - value2);
if (result < 0f) {
return -1;
} else if (result > 0f) {
return 1;
} else {
return 0;
}
return (int) Math.signum(value1 - value2);
}
}

Expand Down Expand Up @@ -171,14 +164,7 @@ public int compareNotNull(int index1, int index2) {
}
}

double result = Math.signum(value1 - value2);
if (result < 0) {
return -1;
} else if (result > 0) {
return 1;
} else {
return 0;
}
return (int) Math.signum(value1 - value2);
}
}

Expand Down

0 comments on commit a921cdd

Please sign in to comment.