Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
716c0045
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
716c0045
编写于
12月 01, 2021
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor builder struct
上级
7ee1cf62
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
8 deletion
+8
-8
source/libs/index/inc/index_fst_util.h
source/libs/index/inc/index_fst_util.h
+2
-2
source/libs/index/src/index_fst.c
source/libs/index/src/index_fst.c
+4
-4
source/libs/index/src/index_fst_util.c
source/libs/index/src/index_fst_util.c
+2
-2
未找到文件。
source/libs/index/inc/index_fst_util.h
浏览文件 @
716c0045
...
@@ -82,8 +82,8 @@ typedef struct FstSlice {
...
@@ -82,8 +82,8 @@ typedef struct FstSlice {
FstSlice
fstSliceCreate
(
uint8_t
*
data
,
uint64_t
len
);
FstSlice
fstSliceCreate
(
uint8_t
*
data
,
uint64_t
len
);
FstSlice
fstSliceCopy
(
FstSlice
*
s
,
int32_t
start
,
int32_t
end
);
FstSlice
fstSliceCopy
(
FstSlice
*
s
,
int32_t
start
,
int32_t
end
);
FstSlice
fstSliceDeepCopy
(
FstSlice
*
s
,
int32_t
start
,
int32_t
end
);
FstSlice
fstSliceDeepCopy
(
FstSlice
*
s
,
int32_t
start
,
int32_t
end
);
bool
fstSliceEmpty
(
FstSlice
*
s
);
bool
fstSlice
Is
Empty
(
FstSlice
*
s
);
int
fstSliceCompare
(
FstSlice
*
s1
,
FstSlice
*
s2
);
int
fstSliceCompare
(
FstSlice
*
s1
,
FstSlice
*
s2
);
void
fstSliceDestroy
(
FstSlice
*
s
);
void
fstSliceDestroy
(
FstSlice
*
s
);
uint8_t
*
fstSliceData
(
FstSlice
*
s
,
int32_t
*
sz
);
uint8_t
*
fstSliceData
(
FstSlice
*
s
,
int32_t
*
sz
);
...
...
source/libs/index/src/index_fst.c
浏览文件 @
716c0045
...
@@ -92,7 +92,7 @@ void fstUnFinishedNodesTopLastFreeze(FstUnFinishedNodes *nodes, CompiledAddr add
...
@@ -92,7 +92,7 @@ void fstUnFinishedNodesTopLastFreeze(FstUnFinishedNodes *nodes, CompiledAddr add
}
}
void
fstUnFinishedNodesAddSuffix
(
FstUnFinishedNodes
*
nodes
,
FstSlice
bs
,
Output
out
)
{
void
fstUnFinishedNodesAddSuffix
(
FstUnFinishedNodes
*
nodes
,
FstSlice
bs
,
Output
out
)
{
FstSlice
*
s
=
&
bs
;
FstSlice
*
s
=
&
bs
;
if
(
fstSliceEmpty
(
s
))
{
if
(
fstSlice
Is
Empty
(
s
))
{
return
;
return
;
}
}
size_t
sz
=
taosArrayGetSize
(
nodes
->
stack
)
-
1
;
size_t
sz
=
taosArrayGetSize
(
nodes
->
stack
)
-
1
;
...
@@ -801,7 +801,7 @@ bool fstBuilderInsert(FstBuilder *b, FstSlice bs, Output in) {
...
@@ -801,7 +801,7 @@ bool fstBuilderInsert(FstBuilder *b, FstSlice bs, Output in) {
void
fstBuilderInsertOutput
(
FstBuilder
*
b
,
FstSlice
bs
,
Output
in
)
{
void
fstBuilderInsertOutput
(
FstBuilder
*
b
,
FstSlice
bs
,
Output
in
)
{
FstSlice
*
s
=
&
bs
;
FstSlice
*
s
=
&
bs
;
if
(
fstSliceEmpty
(
s
))
{
if
(
fstSlice
Is
Empty
(
s
))
{
b
->
len
=
1
;
b
->
len
=
1
;
fstUnFinishedNodesSetRootOutput
(
b
->
unfinished
,
in
);
fstUnFinishedNodesSetRootOutput
(
b
->
unfinished
,
in
);
return
;
return
;
...
@@ -831,7 +831,7 @@ void fstBuilderInsertOutput(FstBuilder *b, FstSlice bs, Output in) {
...
@@ -831,7 +831,7 @@ void fstBuilderInsertOutput(FstBuilder *b, FstSlice bs, Output in) {
OrderType
fstBuilderCheckLastKey
(
FstBuilder
*
b
,
FstSlice
bs
,
bool
ckDup
)
{
OrderType
fstBuilderCheckLastKey
(
FstBuilder
*
b
,
FstSlice
bs
,
bool
ckDup
)
{
FstSlice
*
input
=
&
bs
;
FstSlice
*
input
=
&
bs
;
if
(
fstSliceEmpty
(
&
b
->
last
))
{
if
(
fstSlice
Is
Empty
(
&
b
->
last
))
{
// deep copy or not
// deep copy or not
b
->
last
=
fstSliceCopy
(
&
bs
,
input
->
start
,
input
->
end
);
b
->
last
=
fstSliceCopy
(
&
bs
,
input
->
start
,
input
->
end
);
}
else
{
}
else
{
...
@@ -1115,7 +1115,7 @@ bool fstBoundWithDataIsEmpty(FstBoundWithData *bound) {
...
@@ -1115,7 +1115,7 @@ bool fstBoundWithDataIsEmpty(FstBoundWithData *bound) {
if
(
bound
->
type
==
Unbounded
)
{
if
(
bound
->
type
==
Unbounded
)
{
return
true
;
return
true
;
}
else
{
}
else
{
return
fstSliceEmpty
(
&
bound
->
data
);
return
fstSlice
Is
Empty
(
&
bound
->
data
);
}
}
}
}
...
...
source/libs/index/src/index_fst_util.c
浏览文件 @
716c0045
...
@@ -122,7 +122,7 @@ FstSlice fstSliceDeepCopy(FstSlice *s, int32_t start, int32_t end) {
...
@@ -122,7 +122,7 @@ FstSlice fstSliceDeepCopy(FstSlice *s, int32_t start, int32_t end) {
assert
(
tlen
<=
alen
);
assert
(
tlen
<=
alen
);
uint8_t
*
buf
=
malloc
(
sizeof
(
uint8_t
)
*
tlen
);
uint8_t
*
buf
=
malloc
(
sizeof
(
uint8_t
)
*
tlen
);
memcpy
(
buf
,
data
,
tlen
);
memcpy
(
buf
,
data
+
start
,
tlen
);
FstString
*
str
=
malloc
(
sizeof
(
FstString
));
FstString
*
str
=
malloc
(
sizeof
(
FstString
));
str
->
data
=
buf
;
str
->
data
=
buf
;
...
@@ -135,7 +135,7 @@ FstSlice fstSliceDeepCopy(FstSlice *s, int32_t start, int32_t end) {
...
@@ -135,7 +135,7 @@ FstSlice fstSliceDeepCopy(FstSlice *s, int32_t start, int32_t end) {
ans
.
end
=
tlen
-
1
;
ans
.
end
=
tlen
-
1
;
return
ans
;
return
ans
;
}
}
bool
fstSliceEmpty
(
FstSlice
*
s
)
{
bool
fstSlice
Is
Empty
(
FstSlice
*
s
)
{
return
s
->
str
==
NULL
||
s
->
start
<
0
||
s
->
end
<
0
;
return
s
->
str
==
NULL
||
s
->
start
<
0
||
s
->
end
<
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录