Skip to content

Commit 13ee43a

Browse files
committed
A small optimization to load empty reviews
1 parent 8a1baf6 commit 13ee43a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

models/issues/comment_code.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issu
8686
ids = append(ids, comment.ReviewID)
8787
}
8888
}
89-
if err := e.In("id", ids).Find(&reviews); err != nil {
90-
return nil, err
89+
if len(ids) > 0 {
90+
if err := e.In("id", ids).Find(&reviews); err != nil {
91+
return nil, err
92+
}
9193
}
9294

9395
n := 0

0 commit comments

Comments
 (0)