Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

insert 函数抛出IndexOutOfBoundsException #31

Closed
neofung opened this issue Dec 9, 2019 · 1 comment
Closed

insert 函数抛出IndexOutOfBoundsException #31

neofung opened this issue Dec 9, 2019 · 1 comment

Comments

@neofung
Copy link

neofung commented Dec 9, 2019

private void buildDoubleArrayTrie(int keySize)
{
progress = 0;
this.keySize = keySize;
resize(65536 * 32); // 32个双字节
base[0] = 1;
nextCheckPos = 0;
State root_node = this.rootState;
List<Map.Entry<Integer, State>> siblings = new ArrayList<Map.Entry<Integer, State>>(root_node.getSuccess().entrySet().size());
fetch(root_node, siblings);
insert(siblings);
}

#846 行,如果siblings是空列表,还有需要插入么,如果为空列表,则会导致insert 函数抛出IndexOutOfBoundsException

@hankcs
Copy link
Owner

hankcs commented Dec 9, 2019

感谢反馈,已经修复,请参考上面的commit。
如果还有问题,欢迎重开issue。

@hankcs hankcs closed this as completed in 89c7355 Dec 9, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants