1
0
mirror of https://github.com/fumiama/emozi.git synced 2026-06-26 15:07:03 +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) lstbuf = append(lstbuf, x)
return nil return nil
}) })
if err != nil {
c.字表缓存[ch] = nil
return nil, lstbuf, err
}
if len(lstbuf) == 0 { if len(lstbuf) == 0 {
c.字表缓存[ch] = nil c.字表缓存[ch] = nil
return nil, lstbuf, ErrNoSuchChar if err == nil {
err = ErrNoSuchChar
}
return nil, lstbuf, err
} }
lstsave := make([]字表, len(lstbuf)) lstsave := make([]字表, len(lstbuf))
copy(lstsave, lstbuf) copy(lstsave, lstbuf)

View File

@@ -49,7 +49,7 @@ var 部首后备 = map[rune]string{
'品': string(), '品': string(),
'龠': string(), '龠': string(),
'冊': string(), '冊': string(),
'㗊': string(), '㗊': "💠",
'舌': "👅", '舌': "👅",
'干': string(), '干': string(),
'𧮫': string(), '𧮫': string(),

BIN
字.db

Binary file not shown.