Skip to content

Commit

Permalink
Ensure numToSelect ≤ actual number of matches
Browse files Browse the repository at this point in the history
  • Loading branch information
jameeters committed Dec 21, 2022
1 parent a1a57b6 commit 99d5b16
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/pankratzlab/kdmatch/Match.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ String getFormattedResults(int numToSelect) {
}

Stream<String> getStatusFileLines(int numToSelect) {
numToSelect = Math.min(numToSelect, this.matches.size());
Stream.Builder<String> streamBuilder = Stream.builder();
streamBuilder.add(String.join("\t", sample.ID, "1", sample.ID));
for (Sample s : this.matches.subList(0, numToSelect)) {
Expand Down

0 comments on commit 99d5b16

Please sign in to comment.