mirror of
https://github.com/eeeXun/GTT.git
synced 2025-05-21 18:10:17 -07:00
refactor: no need to check if tag exist in posSet
This commit is contained in:
parent
97d782c264
commit
7849553356
@ -16,11 +16,7 @@ func (t *posWords) add(s string) {
|
|||||||
type posSet map[string][]posWords
|
type posSet map[string][]posWords
|
||||||
|
|
||||||
func (set posSet) add(tag string, words 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)
|
set[tag] = append(set[tag], words)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (set posSet) format() (s string) {
|
func (set posSet) format() (s string) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user