1
0
mirror of https://github.com/fumiama/emozi.git synced 2026-06-11 05:30:35 +08:00

optimize(data): 查字

This commit is contained in:
源文雨
2024-02-15 21:19:43 +09:00
parent 3116a2fa7e
commit 7c296fa9b7
3 changed files with 5 additions and 6 deletions

View File

@@ -109,13 +109,12 @@ func (c *Coder) 查字(ch rune, lstbuf []字表) ([]字表, []字表, error) {
lstbuf = append(lstbuf, x)
return nil
})
if err != nil {
c.字表缓存[ch] = nil
return nil, lstbuf, err
}
if len(lstbuf) == 0 {
c.字表缓存[ch] = nil
return nil, lstbuf, ErrNoSuchChar
if err == nil {
err = ErrNoSuchChar
}
return nil, lstbuf, err
}
lstsave := make([]字表, len(lstbuf))
copy(lstsave, lstbuf)