Skip to content

Commit 881cd48

Browse files
committed
refactor the for loop
1 parent 4ce8881 commit 881cd48

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

models/issue_indexer.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ func InitIssueIndexer() error {
5959

6060
// populateIssueIndexer populate the issue indexer with issue data
6161
func populateIssueIndexer() {
62-
page := 1
63-
for {
62+
for page := 1; ; page++ {
6463
repos, _, err := SearchRepositoryByName(&SearchRepoOptions{
6564
Page: page,
6665
PageSize: RepositoryListDefaultPageSize,
@@ -75,7 +74,7 @@ func populateIssueIndexer() {
7574
if len(repos) == 0 {
7675
return
7776
}
78-
page++
77+
7978
for _, repo := range repos {
8079
is, err := Issues(&IssuesOptions{
8180
RepoIDs: []int64{repo.ID},

0 commit comments

Comments
 (0)