diff options
Diffstat (limited to 'services/migrations/codecommit.go')
-rw-r--r-- | services/migrations/codecommit.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/services/migrations/codecommit.go b/services/migrations/codecommit.go index 9317156ab0..d08b2e6d4a 100644 --- a/services/migrations/codecommit.go +++ b/services/migrations/codecommit.go @@ -155,10 +155,7 @@ func (c *CodeCommitDownloader) GetPullRequests(ctx context.Context, page, perPag } startIndex := (page - 1) * perPage - endIndex := page * perPage - if endIndex > len(allPullRequestIDs) { - endIndex = len(allPullRequestIDs) - } + endIndex := min(page*perPage, len(allPullRequestIDs)) batch := allPullRequestIDs[startIndex:endIndex] prs := make([]*base.PullRequest, 0, len(batch)) |