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

Specify known size of HashMap in two more places

上级 0196cf90
......@@ -22,7 +22,6 @@ import org.h2.table.Column;
import org.h2.table.ColumnResolver;
import org.h2.table.Table;
import org.h2.table.TableFilter;
import org.h2.util.New;
import org.h2.util.StatementBuilder;
import org.h2.util.StringUtils;
import org.h2.value.DataType;
......@@ -125,7 +124,7 @@ public class Aggregate extends Expression {
*/
static final int HISTOGRAM = 16;
private static final HashMap<String, Integer> AGGREGATES = New.hashMap();
private static final HashMap<String, Integer> AGGREGATES = new HashMap<>(24);
private final int type;
private final Select select;
......@@ -156,6 +155,9 @@ public class Aggregate extends Expression {
}
static {
/*
* Update initial size of AGGREGATES after editing the following list.
*/
addAggregate("COUNT", COUNT);
addAggregate("SUM", SUM);
addAggregate("MIN", MIN);
......
......@@ -19,7 +19,6 @@ import java.util.HashMap;
import java.util.UUID;
import org.h2.mvstore.DataUtils;
import org.h2.mvstore.WriteBuffer;
import org.h2.util.New;
/**
* A data type implementation for the most common data types, including
......@@ -94,8 +93,7 @@ public class ObjectDataType implements DataType {
Float.class, Double.class, BigDecimal.class, String.class,
UUID.class, Date.class };
private static final HashMap<Class<?>, Integer> COMMON_CLASSES_MAP = New
.hashMap();
private static final HashMap<Class<?>, Integer> COMMON_CLASSES_MAP = new HashMap<>(COMMON_CLASSES.length);
private AutoDetectDataType last = new StringType(this);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论