提交 591aba70 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Remove useless null check in AggregateDataCountAll.getValue()

上级 5a98d6d7
...@@ -41,8 +41,7 @@ class AggregateDataCount extends AggregateData { ...@@ -41,8 +41,7 @@ class AggregateDataCount extends AggregateData {
count = 0; count = 0;
} }
} }
Value v = ValueLong.get(count); return ValueLong.get(count).convertTo(dataType);
return v.convertTo(dataType);
} }
} }
...@@ -9,7 +9,6 @@ import org.h2.engine.Database; ...@@ -9,7 +9,6 @@ import org.h2.engine.Database;
import org.h2.message.DbException; import org.h2.message.DbException;
import org.h2.value.Value; import org.h2.value.Value;
import org.h2.value.ValueLong; import org.h2.value.ValueLong;
import org.h2.value.ValueNull;
/** /**
* Data stored while calculating a COUNT(*) aggregate. * Data stored while calculating a COUNT(*) aggregate.
...@@ -30,8 +29,7 @@ class AggregateDataCountAll extends AggregateData { ...@@ -30,8 +29,7 @@ class AggregateDataCountAll extends AggregateData {
if (distinct) { if (distinct) {
throw DbException.throwInternalError(); throw DbException.throwInternalError();
} }
Value v = ValueLong.get(count); return ValueLong.get(count).convertTo(dataType);
return v == null ? ValueNull.INSTANCE : v.convertTo(dataType);
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论