提交 ccca561d 编写于 作者: dengyihao's avatar dengyihao

update fst build struct

上级 260588b6
...@@ -313,6 +313,18 @@ void fstBuilderDestroy(FstBuilder *b) { ...@@ -313,6 +313,18 @@ void fstBuilderDestroy(FstBuilder *b) {
fstRegistryDestroy(b->registry); fstRegistryDestroy(b->registry);
free(b); free(b);
} }
bool fstBuilderInsert(FstBuilder *b, FstSlice bs, Output in) {
OrderType t = fstBuilderCheckLastKey(b, bs, true);
if (t == Ordered) {
// add log info
fstBuilderInsertOutput(b, bs, in);
return true;
}
return false;
}
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 (fstSliceEmpty(s)) {
...@@ -422,6 +434,8 @@ void fstLastTransitionDestroy(FstLastTransition *trn) { ...@@ -422,6 +434,8 @@ void fstLastTransitionDestroy(FstLastTransition *trn) {
} }
void fstBuilderNodeUnfinishedLastCompiled(FstBuilderNodeUnfinished *unNode, CompiledAddr addr) { void fstBuilderNodeUnfinishedLastCompiled(FstBuilderNodeUnfinished *unNode, CompiledAddr addr) {
FstLastTransition *trn = unNode->last; FstLastTransition *trn = unNode->last;
if (trn == NULL) { return; }
FstTransition t = {.inp = trn->inp, .out = trn->out, .addr = addr}; FstTransition t = {.inp = trn->inp, .out = trn->out, .addr = addr};
taosArrayPush(unNode->node->trans, &t); taosArrayPush(unNode->node->trans, &t);
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册