Skip to content

Commit

Permalink
fix: fix slice init length
Browse files Browse the repository at this point in the history
Signed-off-by: cuishuang <[email protected]>
  • Loading branch information
cuishuang authored and alimy committed Oct 10, 2024
1 parent cc79e11 commit af60573
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/dao/jinzhu/topics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit af60573

Please sign in to comment.