Merge db.Iterate and IterateObjects (#21641)
These two functions are similiar, merge them.
This commit is contained in:
parent
4ae3f76217
commit
9a70a12a34
12 changed files with 77 additions and 51 deletions
|
@ -21,10 +21,9 @@ import (
|
|||
func iteratePRs(ctx context.Context, repo *repo_model.Repository, each func(*repo_model.Repository, *issues_model.PullRequest) error) error {
|
||||
return db.Iterate(
|
||||
ctx,
|
||||
new(issues_model.PullRequest),
|
||||
builder.Eq{"base_repo_id": repo.ID},
|
||||
func(idx int, bean interface{}) error {
|
||||
return each(repo, bean.(*issues_model.PullRequest))
|
||||
func(ctx context.Context, bean *issues_model.PullRequest) error {
|
||||
return each(repo, bean)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue