go-darts
go-darts copied to clipboard
Darts.go:75 cap func should be replaced by len func
if you wanna build a DA Trie with thousands of nodes, there may cause errors.
Could you elaborate or give some test case? I intended to get the capacity of the slice, thus using cap func. Can't simply replace it with len func.
https://github.com/awsong/go-darts/blob/1b63d94fdbea0f52b98c2d5ff42fb0b8f9de77b2/darts.go#L74-L84
"if newSize > cap(d.darts.Base) " 应该换成 if newSize > len(d.darts.Base) 。不改 TestExactMatchSearch测试都通不过。