Skip to content

Commit

Permalink
Remove redundant firstNonNaN method
Browse files Browse the repository at this point in the history
  • Loading branch information
raunaqmorarka authored and sopel39 committed Mar 11, 2022
1 parent 67d2df9 commit a4c7745
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions core/trino-main/src/main/java/io/trino/cost/JoinStatsRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
import static io.trino.sql.ExpressionUtils.extractConjuncts;
import static io.trino.sql.planner.plan.Patterns.join;
import static io.trino.sql.tree.ComparisonExpression.Operator.EQUAL;
import static io.trino.util.MoreMath.firstNonNaN;
import static java.lang.Double.NaN;
import static java.lang.Double.isNaN;
import static java.lang.Math.min;
import static java.util.Comparator.comparingDouble;
import static java.util.Objects.requireNonNull;
Expand Down Expand Up @@ -250,16 +250,6 @@ private PlanNodeStatsEstimate filterByAuxiliaryClause(PlanNodeStatsEstimate stat
return normalizer.normalize(result.build(), types);
}

private static double firstNonNaN(double... values)
{
for (double value : values) {
if (!isNaN(value)) {
return value;
}
}
throw new IllegalArgumentException("All values are NaN");
}

/**
* Calculates statistics for unmatched left rows.
*/
Expand Down

0 comments on commit a4c7745

Please sign in to comment.