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:
parent
97d782c264
commit
7849553356
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user