mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-10 08:21:21 +00:00
If we are a returning a collection of all things, we might as well use the maximum page size to minimize HTTP requests.
This commit is contained in:
@@ -220,7 +220,7 @@ public class GHOrganization extends GHPerson {
|
||||
*/
|
||||
public List<GHRepository> getRepositoriesWithOpenPullRequests() throws IOException {
|
||||
List<GHRepository> r = new ArrayList<GHRepository>();
|
||||
for (GHRepository repository : listRepositories()) {
|
||||
for (GHRepository repository : listRepositories(100)) {
|
||||
repository.wrap(root);
|
||||
List<GHPullRequest> pullRequests = repository.getPullRequests(GHIssueState.OPEN);
|
||||
if (pullRequests.size() > 0) {
|
||||
|
||||
@@ -52,7 +52,7 @@ public abstract class GHPerson extends GHObject {
|
||||
*/
|
||||
public synchronized Map<String,GHRepository> getRepositories() throws IOException {
|
||||
Map<String,GHRepository> repositories = new TreeMap<String, GHRepository>();
|
||||
for (GHRepository r : listRepositories()) {
|
||||
for (GHRepository r : listRepositories(100)) {
|
||||
repositories.put(r.getName(),r);
|
||||
}
|
||||
return Collections.unmodifiableMap(repositories);
|
||||
|
||||
Reference in New Issue
Block a user