Skip to content
Permalink
Browse files

Do not copy all build numbers in case of descending search (#3228)

[JENKINS-50056] - Do not copy all build numbers in case of descending search
  • Loading branch information...
Jimilian authored and oleg-nenashev committed Mar 10, 2018
1 parent cfddf9f commit 6232491965ab654ea9a020c3088421ce2d61705c
Showing with 4 additions and 5 deletions.
  1. +4 −5 core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java
@@ -29,10 +29,9 @@
import java.io.File;
import java.io.IOException;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
@@ -336,9 +335,9 @@ public boolean runExists(int number) {
return null;
case DESC:
// TODO again could be made more efficient
List<Integer> reversed = new ArrayList<Integer>(numberOnDisk);
Collections.reverse(reversed);
for (int m : reversed) {
ListIterator<Integer> iterator = numberOnDisk.listIterator(numberOnDisk.size());
while(iterator.hasPrevious()) {
int m = iterator.previous();
if (m > n) {
continue;
}

0 comments on commit 6232491

Please sign in to comment.
You can’t perform that action at this time.