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

Remove ValueHashMap.newInstance()

上级 77ab3a41
......@@ -38,7 +38,7 @@ class AggregateDataHistogram extends AggregateData {
@Override
void add(Database database, int dataType, Value v) {
if (distinctValues == null) {
distinctValues = ValueHashMap.newInstance();
distinctValues = new ValueHashMap<>();
}
LongDataCounter a = distinctValues.get(v);
if (a == null) {
......
......@@ -25,7 +25,7 @@ class AggregateDataMode extends AggregateData {
return;
}
if (distinctValues == null) {
distinctValues = ValueHashMap.newInstance();
distinctValues = new ValueHashMap<>();
}
LongDataCounter a = distinctValues.get(v);
if (a == null) {
......
......@@ -40,7 +40,7 @@ public class HashIndex extends BaseIndex {
}
private void reset() {
rows = ValueHashMap.newInstance();
rows = new ValueHashMap<>();
}
@Override
......
......@@ -45,7 +45,7 @@ public class NonUniqueHashIndex extends BaseIndex {
}
private void reset() {
rows = ValueHashMap.newInstance();
rows = new ValueHashMap<>();
rowCount = 0;
}
......
......@@ -147,7 +147,7 @@ public class LocalResultImpl implements LocalResult {
public void setDistinct() {
assert distinctIndexes == null;
distinct = true;
distinctRows = ValueHashMap.newInstance();
distinctRows = new ValueHashMap<>();
}
/**
......@@ -159,7 +159,7 @@ public class LocalResultImpl implements LocalResult {
public void setDistinct(int[] distinctIndexes) {
assert !distinct;
this.distinctIndexes = distinctIndexes;
distinctRows = ValueHashMap.newInstance();
distinctRows = new ValueHashMap<>();
}
/**
......@@ -202,7 +202,7 @@ public class LocalResultImpl implements LocalResult {
return external.contains(values);
}
if (distinctRows == null) {
distinctRows = ValueHashMap.newInstance();
distinctRows = new ValueHashMap<>();
for (Value[] row : rows) {
ValueArray array = getArrayOfDistinct(row);
distinctRows.put(array, array.getList());
......
......@@ -38,15 +38,6 @@ public class ValueHashMap<V> extends HashBase {
Value[] keys;
V[] values;
/**
* Create a new value hash map.
*
* @return the object
*/
public static <T> ValueHashMap<T> newInstance() {
return new ValueHashMap<>();
}
@Override
@SuppressWarnings("unchecked")
protected void reset(int newLevel) {
......
......@@ -47,7 +47,7 @@ public class TestValueHashMap extends TestBase implements DataHandler {
}
private void testNotANumber() {
ValueHashMap<Integer> map = ValueHashMap.newInstance();
ValueHashMap<Integer> map = new ValueHashMap<>();
for (int i = 1; i < 100; i++) {
double d = Double.longBitsToDouble(0x7ff0000000000000L | i);
ValueDouble v = ValueDouble.get(d);
......@@ -57,7 +57,7 @@ public class TestValueHashMap extends TestBase implements DataHandler {
}
private void testRandomized() {
ValueHashMap<Value> map = ValueHashMap.newInstance();
ValueHashMap<Value> map = new ValueHashMap<>();
HashMap<Value, Value> hash = new HashMap<>();
Random random = new Random(1);
Comparator<Value> vc = new Comparator<Value>() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论