Skip to content

Commit d306e15

Browse files
committed
increase max term length from 255 to 1024
1 parent 9c2bded commit d306e15

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

idx.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ const (
4949
sizeState
5050
)
5151

52+
const MAX_TERM_LENGTH = 1024
53+
5254
// ReadIndex reads dictionary index into a memory and returns in-memory index structure
5355
func ReadIndex(filename string, synPath string, info *Info) (*Idx, error) {
5456
data, err := os.ReadFile(filename)
@@ -65,7 +67,7 @@ func ReadIndex(filename string, synPath string, info *Info) (*Idx, error) {
6567

6668
wordPrefixMap := WordPrefixMap{}
6769

68-
var buf [255]byte // temporary buffer
70+
var buf [MAX_TERM_LENGTH]byte // temporary buffer
6971
var bufPos uint8
7072
state := termState
7173

0 commit comments

Comments
 (0)