v/GTT
1
0
mirror of https://github.com/eeeXun/GTT.git synced 2025-05-21 10:00:59 -07:00

refactor: no need to check if tag exist in posSet

This commit is contained in:
eeeXun 2023-04-19 14:32:35 +08:00
parent 97d782c264
commit 7849553356

View File

@ -16,12 +16,8 @@ func (t *posWords) add(s string) {
type posSet map[string][]posWords
func (set posSet) add(tag string, words posWords) {
if _, ok := set[tag]; !ok {
set[tag] = []posWords{words}
} else {
set[tag] = append(set[tag], words)
}
}
func (set posSet) format() (s string) {
for tag := range set {