cedar-go
cedar-go copied to clipboard
A go implemention of efficiently-updatable double-array trie
1、children must be different.Otherwise, there will be a dead cycle
执行下面段代码,会卡在第4行(删除第4行前的一行或多行均不会出现卡主的情况): ```go myCedar.Insert([]byte("李沁"), 1) myCedar.Delete([]byte("李沁")) myCedar.Insert([]byte("测试"), 1) myCedar.Insert([]byte("的淡"), 1) // 在该行卡主 myCedar.Insert([]byte("的"), 1) ``` 经过断点调试可发现卡主的原因是程序在cedar.go源文件的236~237行处于死循环状态: ```go if hasChild && keepOrder { c = &da.Ninfos[base^int(*c)].Sibling for da.Ordered && *c != 0...
如果一个key,不存在,调用Update方法,会因为*p+value超出ValueLimit而报错ErrInvalidValue cedar: invalid value