Skip to content

Commit a34862a

Browse files
committed
use builder.In
1 parent dcc6c2b commit a34862a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

models/issues/review_list.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,7 @@ func (opts *FindReviewOptions) toCond() builder.Cond {
108108
cond = cond.And(builder.Eq{"reviewer_id": opts.ReviewerID})
109109
}
110110
if len(opts.Types) > 0 {
111-
typeConds := make([]builder.Cond, 0, len(opts.Types))
112-
for _, reviewType := range opts.Types {
113-
typeConds = append(typeConds, builder.Eq{"type": reviewType})
114-
}
115-
cond = cond.And(builder.Or(typeConds...))
111+
cond = cond.And(builder.In("type", opts.Types))
116112
}
117113
if opts.OfficialOnly {
118114
cond = cond.And(builder.Eq{"official": true})

0 commit comments

Comments
 (0)