Skip to content

Commit 4920b0c

Browse files
committed
refactor(handou): 优化游戏初始化中的切片容量设置
- 将 tickExistPinyin 切片的容量设置从动态调整为固定大小 - 保持其他数据结构的初始化逻辑不变 - 提高内存分配效率和代码一致性
1 parent 4ab805b commit 4920b0c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

plugin/handou/game.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ func newHandouGame(target idiomJSON) func(string) (bool, []byte, error) {
252252

253253
tickTruePinyin = make([]string, class)
254254
tickExistChars = make([]string, class)
255-
tickExistPinyin = make([]string, 0, class)
255+
tickExistPinyin = make([]string, class)
256256

257257
// 成语记录
258258
record = make([]string, 0, 7)

0 commit comments

Comments
 (0)