提交 64e4aca4 authored 作者: Noel Grandin's avatar Noel Grandin

remove redundant code, we are already comparing a==b at the start of the

method
上级 a9d69199
...@@ -12,7 +12,6 @@ import java.sql.ResultSet; ...@@ -12,7 +12,6 @@ import java.sql.ResultSet;
import java.sql.ResultSetMetaData; import java.sql.ResultSetMetaData;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.Arrays; import java.util.Arrays;
import org.h2.api.ErrorCode; import org.h2.api.ErrorCode;
import org.h2.message.DbException; import org.h2.message.DbException;
import org.h2.mvstore.DataUtils; import org.h2.mvstore.DataUtils;
...@@ -133,20 +132,13 @@ public class ValueDataType implements DataType { ...@@ -133,20 +132,13 @@ public class ValueDataType implements DataType {
if (aNull || bNull) { if (aNull || bNull) {
return SortOrder.compareNull(aNull, sortType); return SortOrder.compareNull(aNull, sortType);
} }
int comp = compareTypeSafe(a, b); int comp = a.compareTypeSafe(b, compareMode);
if ((sortType & SortOrder.DESCENDING) != 0) { if ((sortType & SortOrder.DESCENDING) != 0) {
comp = -comp; comp = -comp;
} }
return comp; return comp;
} }
private int compareTypeSafe(Value a, Value b) {
if (a == b) {
return 0;
}
return a.compareTypeSafe(b, compareMode);
}
@Override @Override
public int getMemory(Object obj) { public int getMemory(Object obj) {
if (obj instanceof SpatialKey) { if (obj instanceof SpatialKey) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论