Skip to content

Commit f8c2774

Browse files
committed
simplify code
1 parent 5750b40 commit f8c2774

File tree

1 file changed

+1
-8
lines changed
  • x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date

1 file changed

+1
-8
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DayName.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,7 @@ public boolean foldable() {
106106
@Override
107107
public EvalOperator.ExpressionEvaluator.Factory toEvaluator(ToEvaluator toEvaluator) {
108108
var fieldEvaluator = toEvaluator.apply(field);
109-
return getEvaluator(field().dataType(), fieldEvaluator);
110-
}
111-
112-
private EvalOperator.ExpressionEvaluator.Factory getEvaluator(
113-
DataType dateType,
114-
EvalOperator.ExpressionEvaluator.Factory fieldEvaluator
115-
) {
116-
if (dateType == DataType.DATE_NANOS) {
109+
if (field().dataType() == DataType.DATE_NANOS) {
117110
return new DayNameNanosEvaluator.Factory(source(), fieldEvaluator, configuration().zoneId(), configuration().locale());
118111
}
119112
return new DayNameMillisEvaluator.Factory(source(), fieldEvaluator, configuration().zoneId(), configuration().locale());

0 commit comments

Comments
 (0)