提交 be7ab707 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Join conditions with || in ObjectDataType.ObjectArrayType.getMemory()

上级 538ab78a
...@@ -1247,21 +1247,13 @@ public class ObjectDataType implements DataType { ...@@ -1247,21 +1247,13 @@ public class ObjectDataType implements DataType {
Class<?> type = obj.getClass().getComponentType(); Class<?> type = obj.getClass().getComponentType();
if (type.isPrimitive()) { if (type.isPrimitive()) {
int len = Array.getLength(obj); int len = Array.getLength(obj);
if (type == boolean.class) { if (type == boolean.class || type == byte.class) {
size += len; size += len;
} else if (type == byte.class) { } else if (type == char.class || type == short.class) {
size += len;
} else if (type == char.class) {
size += len * 2;
} else if (type == short.class) {
size += len * 2; size += len * 2;
} else if (type == int.class) { } else if (type == int.class || type == float.class) {
size += len * 4; size += len * 4;
} else if (type == float.class) { } else if (type == double.class || type == long.class) {
size += len * 4;
} else if (type == double.class) {
size += len * 8;
} else if (type == long.class) {
size += len * 8; size += len * 8;
} }
} else { } else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论