fix: fix slice init length

Signed-off-by: cuishuang <imcusg@gmail.com>
pull/582/head
cuishuang 4 months ago committed by Michael Li
parent cc79e112d2
commit af60573d0c
No known key found for this signature in database

@ -173,7 +173,7 @@ func (s *topicSrv) listTags(conditions *ms.ConditionsT, limit int, offset int) (
tagMap[item.UserID] = append(tagMap[item.UserID], item)
res = append(res, item)
}
ids := make([]int64, len(tagMap))
ids := make([]int64, 0, len(tagMap))
for userId := range tagMap {
ids = append(ids, userId)
}
@ -332,7 +332,7 @@ func (s *topicSrvA) ListTags(typ cs.TagType, offset, limit int) (res cs.TagList,
tagMap[item.UserID] = append(tagMap[item.UserID], item)
res = append(res, item)
}
ids := make([]int64, len(tagMap))
ids := make([]int64, 0, len(tagMap))
for userId := range tagMap {
ids = append(ids, userId)
}

Loading…
Cancel
Save