Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
14851c03
提交
14851c03
authored
14 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small improvements.
上级
bb517162
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
9 行增加
和
51 行删除
+9
-51
SortOrder.java
h2/src/main/org/h2/result/SortOrder.java
+1
-1
SHA256.java
h2/src/main/org/h2/security/SHA256.java
+1
-2
Data.java
h2/src/main/org/h2/store/Data.java
+7
-48
没有找到文件。
h2/src/main/org/h2/result/SortOrder.java
浏览文件 @
14851c03
...
...
@@ -126,7 +126,7 @@ public class SortOrder implements Comparator<Value[]> {
* @return the result of the comparison
*/
public
int
compare
(
Value
[]
a
,
Value
[]
b
)
{
for
(
int
i
=
0
;
i
<
indexes
.
length
;
i
++)
{
for
(
int
i
=
0
,
len
=
indexes
.
length
;
i
<
len
;
i
++)
{
int
idx
=
indexes
[
i
];
int
type
=
sortTypes
[
i
];
Value
ao
=
a
[
idx
];
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/security/SHA256.java
浏览文件 @
14851c03
...
...
@@ -69,8 +69,7 @@ public class SHA256 {
buff
[
n
++]
=
(
byte
)
(
c
>>
8
);
buff
[
n
++]
=
(
byte
)
c
;
}
for
(
int
i
=
0
;
i
<
password
.
length
;
i
++)
{
char
c
=
password
[
i
];
for
(
char
c
:
password
)
{
buff
[
n
++]
=
(
byte
)
(
c
>>
8
);
buff
[
n
++]
=
(
byte
)
c
;
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/store/Data.java
浏览文件 @
14851c03
...
...
@@ -53,9 +53,6 @@ public class Data {
*/
public
static
final
int
LENGTH_INT
=
4
;
private
static
final
boolean
TEST
=
false
;
private
static
final
int
TEST_OFFSET
=
0
;
/**
* The length of a long value.
*/
...
...
@@ -163,7 +160,7 @@ public class Data {
* @param len the length of the string
* @return the number of bytes required
*/
p
ublic
static
int
getStringWithoutLengthLen
(
String
s
,
int
len
)
{
p
rivate
static
int
getStringWithoutLengthLen
(
String
s
,
int
len
)
{
int
plus
=
0
;
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
char
c
=
s
.
charAt
(
i
);
...
...
@@ -254,19 +251,6 @@ public class Data {
pos
=
p
;
}
/**
* Increase the size to the given length.
* The current position is set to the given value.
*
* @param len the new length
*/
public
void
fill
(
int
len
)
{
pos
=
len
;
if
(
data
.
length
<
len
)
{
checkCapacity
(
len
-
data
.
length
);
}
}
/**
* Create a new buffer for the given handler. The
* handler will decide what type of buffer is created.
...
...
@@ -329,15 +313,6 @@ public class Data {
pos
+=
len
;
}
/**
* Append a number of bytes to this buffer.
*
* @param buff the data
*/
public
void
write
(
byte
[]
buff
)
{
write
(
buff
,
0
,
buff
.
length
);
}
/**
* Copy a number of bytes to the given buffer from the current position. The
* current position is incremented accordingly.
...
...
@@ -351,16 +326,6 @@ public class Data {
pos
+=
len
;
}
/**
* Copy a number of bytes to the given buffer from the current position. The
* current position is incremented accordingly.
*
* @param buff the output buffer
*/
public
void
read
(
byte
[]
buff
)
{
read
(
buff
,
0
,
buff
.
length
);
}
/**
* Append one single byte.
*
...
...
@@ -405,9 +370,6 @@ public class Data {
*/
public
void
writeValue
(
Value
v
)
{
int
start
=
pos
;
if
(
TEST
)
{
pos
+=
TEST_OFFSET
;
}
if
(
v
==
ValueNull
.
INSTANCE
)
{
data
[
pos
++]
=
0
;
return
;
...
...
@@ -626,9 +588,6 @@ public class Data {
* @return the value
*/
public
Value
readValue
()
{
if
(
TEST
)
{
pos
+=
TEST_OFFSET
;
}
int
type
=
data
[
pos
++]
&
255
;
switch
(
type
)
{
case
Value
.
NULL
:
...
...
@@ -785,11 +744,7 @@ public class Data {
* @param handler the data handler for lobs
* @return the number of bytes required to store this value
*/
public
static
int
getValueLen
(
Value
v
,
DataHandler
handler
)
{
return
getValueLen2
(
v
,
handler
)
+
TEST_OFFSET
;
}
private
static
int
getValueLen2
(
Value
v
,
DataHandler
handler
)
{
private
static
int
getValueLen
(
Value
v
,
DataHandler
handler
)
{
if
(
v
==
ValueNull
.
INSTANCE
)
{
return
1
;
}
...
...
@@ -1129,7 +1084,11 @@ public class Data {
*/
public
void
fillAligned
()
{
// 0..6 > 8, 7..14 > 16, 15..22 > 24, ...
fill
(
MathUtils
.
roundUpInt
(
pos
+
2
,
Constants
.
FILE_BLOCK_SIZE
));
int
len
=
MathUtils
.
roundUpInt
(
pos
+
2
,
Constants
.
FILE_BLOCK_SIZE
);
pos
=
len
;
if
(
data
.
length
<
len
)
{
checkCapacity
(
len
-
data
.
length
);
}
}
}
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论