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

(cherry picked from commit 6232491)
  • Loading branch information...
Jimilian authored and olivergondza committed Mar 10, 2018
1 parent 9fb75bb commit 9b69208f7e4aca3f5970e71343571e575d803f4d
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 9b69208

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