Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 6232491
Showing 1 changed file with 4 additions and 5 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 6232491

Please sign in to comment.