Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
c3780d9d
提交
c3780d9d
authored
9月 21, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove ValueHashMap.newInstance()
上级
77ab3a41
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
9 行增加
和
18 行删除
+9
-18
AggregateDataHistogram.java
...n/org/h2/expression/aggregate/AggregateDataHistogram.java
+1
-1
AggregateDataMode.java
...c/main/org/h2/expression/aggregate/AggregateDataMode.java
+1
-1
HashIndex.java
h2/src/main/org/h2/index/HashIndex.java
+1
-1
NonUniqueHashIndex.java
h2/src/main/org/h2/index/NonUniqueHashIndex.java
+1
-1
LocalResultImpl.java
h2/src/main/org/h2/result/LocalResultImpl.java
+3
-3
ValueHashMap.java
h2/src/main/org/h2/util/ValueHashMap.java
+0
-9
TestValueHashMap.java
h2/src/test/org/h2/test/unit/TestValueHashMap.java
+2
-2
没有找到文件。
h2/src/main/org/h2/expression/aggregate/AggregateDataHistogram.java
浏览文件 @
c3780d9d
...
@@ -38,7 +38,7 @@ class AggregateDataHistogram extends AggregateData {
...
@@ -38,7 +38,7 @@ class AggregateDataHistogram extends AggregateData {
@Override
@Override
void
add
(
Database
database
,
int
dataType
,
Value
v
)
{
void
add
(
Database
database
,
int
dataType
,
Value
v
)
{
if
(
distinctValues
==
null
)
{
if
(
distinctValues
==
null
)
{
distinctValues
=
ValueHashMap
.
newInstance
();
distinctValues
=
new
ValueHashMap
<>
();
}
}
LongDataCounter
a
=
distinctValues
.
get
(
v
);
LongDataCounter
a
=
distinctValues
.
get
(
v
);
if
(
a
==
null
)
{
if
(
a
==
null
)
{
...
...
h2/src/main/org/h2/expression/aggregate/AggregateDataMode.java
浏览文件 @
c3780d9d
...
@@ -25,7 +25,7 @@ class AggregateDataMode extends AggregateData {
...
@@ -25,7 +25,7 @@ class AggregateDataMode extends AggregateData {
return
;
return
;
}
}
if
(
distinctValues
==
null
)
{
if
(
distinctValues
==
null
)
{
distinctValues
=
ValueHashMap
.
newInstance
();
distinctValues
=
new
ValueHashMap
<>
();
}
}
LongDataCounter
a
=
distinctValues
.
get
(
v
);
LongDataCounter
a
=
distinctValues
.
get
(
v
);
if
(
a
==
null
)
{
if
(
a
==
null
)
{
...
...
h2/src/main/org/h2/index/HashIndex.java
浏览文件 @
c3780d9d
...
@@ -40,7 +40,7 @@ public class HashIndex extends BaseIndex {
...
@@ -40,7 +40,7 @@ public class HashIndex extends BaseIndex {
}
}
private
void
reset
()
{
private
void
reset
()
{
rows
=
ValueHashMap
.
newInstance
();
rows
=
new
ValueHashMap
<>
();
}
}
@Override
@Override
...
...
h2/src/main/org/h2/index/NonUniqueHashIndex.java
浏览文件 @
c3780d9d
...
@@ -45,7 +45,7 @@ public class NonUniqueHashIndex extends BaseIndex {
...
@@ -45,7 +45,7 @@ public class NonUniqueHashIndex extends BaseIndex {
}
}
private
void
reset
()
{
private
void
reset
()
{
rows
=
ValueHashMap
.
newInstance
();
rows
=
new
ValueHashMap
<>
();
rowCount
=
0
;
rowCount
=
0
;
}
}
...
...
h2/src/main/org/h2/result/LocalResultImpl.java
浏览文件 @
c3780d9d
...
@@ -147,7 +147,7 @@ public class LocalResultImpl implements LocalResult {
...
@@ -147,7 +147,7 @@ public class LocalResultImpl implements LocalResult {
public
void
setDistinct
()
{
public
void
setDistinct
()
{
assert
distinctIndexes
==
null
;
assert
distinctIndexes
==
null
;
distinct
=
true
;
distinct
=
true
;
distinctRows
=
ValueHashMap
.
newInstance
();
distinctRows
=
new
ValueHashMap
<>
();
}
}
/**
/**
...
@@ -159,7 +159,7 @@ public class LocalResultImpl implements LocalResult {
...
@@ -159,7 +159,7 @@ public class LocalResultImpl implements LocalResult {
public
void
setDistinct
(
int
[]
distinctIndexes
)
{
public
void
setDistinct
(
int
[]
distinctIndexes
)
{
assert
!
distinct
;
assert
!
distinct
;
this
.
distinctIndexes
=
distinctIndexes
;
this
.
distinctIndexes
=
distinctIndexes
;
distinctRows
=
ValueHashMap
.
newInstance
();
distinctRows
=
new
ValueHashMap
<>
();
}
}
/**
/**
...
@@ -202,7 +202,7 @@ public class LocalResultImpl implements LocalResult {
...
@@ -202,7 +202,7 @@ public class LocalResultImpl implements LocalResult {
return
external
.
contains
(
values
);
return
external
.
contains
(
values
);
}
}
if
(
distinctRows
==
null
)
{
if
(
distinctRows
==
null
)
{
distinctRows
=
ValueHashMap
.
newInstance
();
distinctRows
=
new
ValueHashMap
<>
();
for
(
Value
[]
row
:
rows
)
{
for
(
Value
[]
row
:
rows
)
{
ValueArray
array
=
getArrayOfDistinct
(
row
);
ValueArray
array
=
getArrayOfDistinct
(
row
);
distinctRows
.
put
(
array
,
array
.
getList
());
distinctRows
.
put
(
array
,
array
.
getList
());
...
...
h2/src/main/org/h2/util/ValueHashMap.java
浏览文件 @
c3780d9d
...
@@ -38,15 +38,6 @@ public class ValueHashMap<V> extends HashBase {
...
@@ -38,15 +38,6 @@ public class ValueHashMap<V> extends HashBase {
Value
[]
keys
;
Value
[]
keys
;
V
[]
values
;
V
[]
values
;
/**
* Create a new value hash map.
*
* @return the object
*/
public
static
<
T
>
ValueHashMap
<
T
>
newInstance
()
{
return
new
ValueHashMap
<>();
}
@Override
@Override
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
protected
void
reset
(
int
newLevel
)
{
protected
void
reset
(
int
newLevel
)
{
...
...
h2/src/test/org/h2/test/unit/TestValueHashMap.java
浏览文件 @
c3780d9d
...
@@ -47,7 +47,7 @@ public class TestValueHashMap extends TestBase implements DataHandler {
...
@@ -47,7 +47,7 @@ public class TestValueHashMap extends TestBase implements DataHandler {
}
}
private
void
testNotANumber
()
{
private
void
testNotANumber
()
{
ValueHashMap
<
Integer
>
map
=
ValueHashMap
.
newInstance
();
ValueHashMap
<
Integer
>
map
=
new
ValueHashMap
<>
();
for
(
int
i
=
1
;
i
<
100
;
i
++)
{
for
(
int
i
=
1
;
i
<
100
;
i
++)
{
double
d
=
Double
.
longBitsToDouble
(
0x7ff0000000000000
L
|
i
);
double
d
=
Double
.
longBitsToDouble
(
0x7ff0000000000000
L
|
i
);
ValueDouble
v
=
ValueDouble
.
get
(
d
);
ValueDouble
v
=
ValueDouble
.
get
(
d
);
...
@@ -57,7 +57,7 @@ public class TestValueHashMap extends TestBase implements DataHandler {
...
@@ -57,7 +57,7 @@ public class TestValueHashMap extends TestBase implements DataHandler {
}
}
private
void
testRandomized
()
{
private
void
testRandomized
()
{
ValueHashMap
<
Value
>
map
=
ValueHashMap
.
newInstance
();
ValueHashMap
<
Value
>
map
=
new
ValueHashMap
<>
();
HashMap
<
Value
,
Value
>
hash
=
new
HashMap
<>();
HashMap
<
Value
,
Value
>
hash
=
new
HashMap
<>();
Random
random
=
new
Random
(
1
);
Random
random
=
new
Random
(
1
);
Comparator
<
Value
>
vc
=
new
Comparator
<
Value
>()
{
Comparator
<
Value
>
vc
=
new
Comparator
<
Value
>()
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论