mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-29 20:12:54 +09:00
Merge db.Iterate and IterateObjects (#21641)
These two functions are similiar, merge them.
This commit is contained in:
@ -30,10 +30,9 @@ import (
|
||||
func iterateRepositories(ctx context.Context, each func(*repo_model.Repository) error) error {
|
||||
err := db.Iterate(
|
||||
ctx,
|
||||
new(repo_model.Repository),
|
||||
builder.Gt{"id": 0},
|
||||
func(idx int, bean interface{}) error {
|
||||
return each(bean.(*repo_model.Repository))
|
||||
func(ctx context.Context, bean *repo_model.Repository) error {
|
||||
return each(bean)
|
||||
},
|
||||
)
|
||||
return err
|
||||
|
Reference in New Issue
Block a user