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

fix insert error

上级 db2bf567
......@@ -273,16 +273,16 @@ void fstStateCompileForAnyTrans(FstCountingWriter *w, CompiledAddr addr, FstBuil
if (FST_BUILDER_NODE_IS_FINAL(node)) {
fstCountingWriterPackUintIn(w, node->finalOutput, oSize);
}
for (size_t i = 0; i < sz; i++) {
for (int32_t i = sz - 1; i >= 0; i--) {
FstTransition *t = taosArrayGet(node->trans, i);
fstCountingWriterPackUintIn(w, t->out, oSize);
}
}
for (size_t i = 0; i < sz; i++) {
for (int32_t i = sz - 1; i >= 0; i--) {
FstTransition *t = taosArrayGet(node->trans, i);
fstPackDeltaIn(w, addr, t->addr, tSize);
}
for (size_t i = 0; i < sz; i++) {
for (int32_t i = sz - 1; i >= 0; i--) {
FstTransition *t = taosArrayGet(node->trans, i);
fstCountingWriterWrite(w, (char *)&t->inp, 1);
//fstPackDeltaIn(w, addr, t->addr, tSize);
......
......@@ -63,7 +63,7 @@
//}
int main(int argc, char** argv) {
FstBuilder *b = fstBuilderCreate(NULL, 1);
FstBuilder *b = fstBuilderCreate(NULL, 0);
{
std::string str("abc");
FstSlice key = fstSliceCreate((uint8_t *)str.c_str(), str.size());
......@@ -74,11 +74,13 @@ int main(int argc, char** argv) {
//std::string str1("bcd");
//FstSlice key1 = fstSliceCreate((uint8_t *)str1.c_str(), str1.size());
//Output val2 = 10;
//
{
//std::string str("bcd");
//FstSlice key = fstSliceCreate((uint8_t *)str.c_str(), str.size());
//Output val = 1;
//fstBuilderInsert(b, key, val);
std::string str("adc");
FstSlice key = fstSliceCreate((uint8_t *)str.c_str(), str.size());
Output val = 2;
fstBuilderInsert(b, key, val);
}
//fstBuilderInsert(b, key1, val2);
fstBuilderFinish(b);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册