mirror of
https://github.com/fumiama/emozi.git
synced 2026-06-11 05:30:35 +08:00
optimize(data): 查字
This commit is contained in:
9
data.go
9
data.go
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user