Skip to content

Commit ed4d353

Browse files
author
Shuo
authored
Merge pull request #634 from openset/develop
Update: use value
2 parents e365e59 + 3c2559b commit ed4d353

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

internal/description/description.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,20 @@ func runDescription(cmd *base.Command, args []string) {
2121
}
2222
var wg sync.WaitGroup
2323
limit := 1 << 7
24-
jobs := make(chan *leetcode.StatStatusPairsType, limit)
24+
jobs := make(chan leetcode.StatStatusPairsType, limit)
2525
for i := 0; i < limit; i++ {
2626
go worker(jobs, &wg)
2727
}
2828
problems := leetcode.ProblemsAll()
2929
for _, problem := range problems.StatStatusPairs {
30-
problem := problem
3130
fmt.Println(problem.Stat.FrontendQuestionId, "\t"+problem.Stat.QuestionTitle)
3231
wg.Add(1)
33-
jobs <- &problem
32+
jobs <- problem
3433
}
3534
wg.Wait()
3635
}
3736

38-
func worker(jobs <-chan *leetcode.StatStatusPairsType, wg *sync.WaitGroup) {
37+
func worker(jobs <-chan leetcode.StatStatusPairsType, wg *sync.WaitGroup) {
3938
for problem := range jobs {
4039
titleSlug := problem.Stat.QuestionTitleSlug
4140
question := leetcode.QuestionData(titleSlug, false).Data.Question

0 commit comments

Comments
 (0)