Skip to content

Commit

Permalink
If we are a returning a collection of all things, we might as well us…
Browse files Browse the repository at this point in the history
…e the maximum page size to minimize HTTP requests.
  • Loading branch information
jglick committed Sep 19, 2016
1 parent df963cb commit 38983df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/kohsuke/github/GHOrganization.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public GHTeam createTeam(String name, Permission p, GHRepository... repositories
*/
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) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/kohsuke/github/GHPerson.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected synchronized void populate() throws IOException {
*/
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);
Expand Down

0 comments on commit 38983df

Please sign in to comment.