Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
I forgot to update two double comparisons to use Double.compare(...).
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Deyton <deytonjh@ornl.gov>
  • Loading branch information
Jordan Deyton committed Jun 22, 2015
1 parent 7cbefe9 commit 8def3fe
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,16 @@ private int findNearestIndex(double d, BinarySearchTree greater,

int index = this.index;

if (d < value) {
int comparison = Double.compare(d, value);
if (comparison < 0) {
if (left != null) {
index = left.findNearestIndex(d, this, lesser);
} else if (lesser != null
&& Double.compare(Math.abs(value - d),
Math.abs(lesser.value - d)) >= 0) {
index = lesser.index;
}
} else if (value < d) {
} else if (comparison > 0) {
if (right != null) {
index = right.findNearestIndex(d, greater, this);
} else if (greater != null
Expand Down

0 comments on commit 8def3fe

Please sign in to comment.