Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
2eeab7e5
提交
2eeab7e5
authored
10 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use array.clone(), which should be faster than System.arraycopy
上级
d588094e
master
noel-pr1
plus33-master
pr/267
stumc-Issue#576
version-1.4.198
version-1.4.197
version-1.4.196
version-1.4.195
version-1.4.194
version-1.4.193
version-1.4.192
version-1.4.191
version-1.4.190
version-1.4.188
无相关合并请求
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
15 行增加
和
7 行删除
+15
-7
Page.java
h2/src/main/org/h2/mvstore/Page.java
+12
-4
MVSecondaryIndex.java
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
+1
-1
LobStorageMap.java
h2/src/main/org/h2/store/LobStorageMap.java
+1
-1
FilePathEncrypt.java
h2/src/main/org/h2/store/fs/FilePathEncrypt.java
+1
-1
没有找到文件。
h2/src/main/org/h2/mvstore/Page.java
浏览文件 @
2eeab7e5
...
@@ -471,14 +471,18 @@ public class Page {
...
@@ -471,14 +471,18 @@ public class Page {
public
void
setChild
(
int
index
,
Page
c
)
{
public
void
setChild
(
int
index
,
Page
c
)
{
if
(
c
==
null
)
{
if
(
c
==
null
)
{
long
oldCount
=
children
[
index
].
count
;
long
oldCount
=
children
[
index
].
count
;
children
=
Arrays
.
copyOf
(
children
,
children
.
length
);
// this is slightly slower:
// children = Arrays.copyOf(children, children.length);
children
=
children
.
clone
();
PageReference
ref
=
new
PageReference
(
null
,
0
,
0
);
PageReference
ref
=
new
PageReference
(
null
,
0
,
0
);
children
[
index
]
=
ref
;
children
[
index
]
=
ref
;
totalCount
-=
oldCount
;
totalCount
-=
oldCount
;
}
else
if
(
c
!=
children
[
index
].
page
||
}
else
if
(
c
!=
children
[
index
].
page
||
c
.
getPos
()
!=
children
[
index
].
pos
)
{
c
.
getPos
()
!=
children
[
index
].
pos
)
{
long
oldCount
=
children
[
index
].
count
;
long
oldCount
=
children
[
index
].
count
;
children
=
Arrays
.
copyOf
(
children
,
children
.
length
);
// this is slightly slower:
// children = Arrays.copyOf(children, children.length);
children
=
children
.
clone
();
PageReference
ref
=
new
PageReference
(
c
,
c
.
pos
,
c
.
totalCount
);
PageReference
ref
=
new
PageReference
(
c
,
c
.
pos
,
c
.
totalCount
);
children
[
index
]
=
ref
;
children
[
index
]
=
ref
;
totalCount
+=
c
.
totalCount
-
oldCount
;
totalCount
+=
c
.
totalCount
-
oldCount
;
...
@@ -492,7 +496,9 @@ public class Page {
...
@@ -492,7 +496,9 @@ public class Page {
* @param key the new key
* @param key the new key
*/
*/
public
void
setKey
(
int
index
,
Object
key
)
{
public
void
setKey
(
int
index
,
Object
key
)
{
keys
=
Arrays
.
copyOf
(
keys
,
keys
.
length
);
// this is slightly slower:
// keys = Arrays.copyOf(keys, keys.length);
keys
=
keys
.
clone
();
Object
old
=
keys
[
index
];
Object
old
=
keys
[
index
];
DataType
keyType
=
map
.
getKeyType
();
DataType
keyType
=
map
.
getKeyType
();
int
mem
=
keyType
.
getMemory
(
key
);
int
mem
=
keyType
.
getMemory
(
key
);
...
@@ -512,7 +518,9 @@ public class Page {
...
@@ -512,7 +518,9 @@ public class Page {
*/
*/
public
Object
setValue
(
int
index
,
Object
value
)
{
public
Object
setValue
(
int
index
,
Object
value
)
{
Object
old
=
values
[
index
];
Object
old
=
values
[
index
];
values
=
Arrays
.
copyOf
(
values
,
values
.
length
);
// this is slightly slower:
// values = Arrays.copyOf(values, values.length);
values
=
values
.
clone
();
DataType
valueType
=
map
.
getValueType
();
DataType
valueType
=
map
.
getValueType
();
addMemory
(
valueType
.
getMemory
(
value
)
-
addMemory
(
valueType
.
getMemory
(
value
)
-
valueType
.
getMemory
(
old
));
valueType
.
getMemory
(
old
));
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
浏览文件 @
2eeab7e5
...
@@ -125,7 +125,7 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex {
...
@@ -125,7 +125,7 @@ public class MVSecondaryIndex extends BaseIndex implements MVIndex {
if
(
indexType
.
isUnique
())
{
if
(
indexType
.
isUnique
())
{
Value
[]
array
=
((
ValueArray
)
v
).
getList
();
Value
[]
array
=
((
ValueArray
)
v
).
getList
();
// don't change the original value
// don't change the original value
array
=
Arrays
.
copyOf
(
array
,
array
.
length
);
array
=
array
.
clone
(
);
array
[
keyColumns
-
1
]
=
ValueLong
.
get
(
Long
.
MIN_VALUE
);
array
[
keyColumns
-
1
]
=
ValueLong
.
get
(
Long
.
MIN_VALUE
);
ValueArray
unique
=
ValueArray
.
get
(
array
);
ValueArray
unique
=
ValueArray
.
get
(
array
);
SearchRow
row
=
convertToSearchRow
((
ValueArray
)
v
);
SearchRow
row
=
convertToSearchRow
((
ValueArray
)
v
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/store/LobStorageMap.java
浏览文件 @
2eeab7e5
...
@@ -246,7 +246,7 @@ public class LobStorageMap implements LobStorageInterface {
...
@@ -246,7 +246,7 @@ public class LobStorageMap implements LobStorageInterface {
throw
DbException
.
throwInternalError
(
"Length is different"
);
throw
DbException
.
throwInternalError
(
"Length is different"
);
}
}
Object
[]
value
=
lobMap
.
get
(
oldLobId
);
Object
[]
value
=
lobMap
.
get
(
oldLobId
);
value
=
Arrays
.
copyOf
(
value
,
value
.
length
);
value
=
value
.
clone
(
);
byte
[]
streamStoreId
=
(
byte
[])
value
[
0
];
byte
[]
streamStoreId
=
(
byte
[])
value
[
0
];
long
lobId
=
generateLobId
();
long
lobId
=
generateLobId
();
value
[
1
]
=
tableId
;
value
[
1
]
=
tableId
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/store/fs/FilePathEncrypt.java
浏览文件 @
2eeab7e5
...
@@ -474,7 +474,7 @@ public class FilePathEncrypt extends FilePathWrapper {
...
@@ -474,7 +474,7 @@ public class FilePathEncrypt extends FilePathWrapper {
updateTweak
(
tweak
);
updateTweak
(
tweak
);
if
(
i
+
CIPHER_BLOCK_SIZE
+
CIPHER_BLOCK_SIZE
>
len
&&
if
(
i
+
CIPHER_BLOCK_SIZE
+
CIPHER_BLOCK_SIZE
>
len
&&
i
+
CIPHER_BLOCK_SIZE
<
len
)
{
i
+
CIPHER_BLOCK_SIZE
<
len
)
{
tweakEnd
=
Arrays
.
copyOf
(
tweak
,
CIPHER_BLOCK_SIZE
);
tweakEnd
=
tweak
.
clone
(
);
updateTweak
(
tweak
);
updateTweak
(
tweak
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论