Skip to content

Commit

Permalink
[ISSUE #3985] Remove shuffle operation before sorting the list of 'Fa…
Browse files Browse the repository at this point in the history
…ultItem'. (#3986)
  • Loading branch information
XiaoyiPeng authored Mar 14, 2022
1 parent 2b51321 commit 03c5a3d
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,8 @@ public String pickOneAtLeast() {
final FaultItem faultItem = elements.nextElement();
tmpList.add(faultItem);
}

if (!tmpList.isEmpty()) {
Collections.shuffle(tmpList);

Collections.sort(tmpList);

final int half = tmpList.size() / 2;
if (half <= 0) {
return tmpList.get(0).getName();
Expand All @@ -84,7 +80,6 @@ public String pickOneAtLeast() {
return tmpList.get(i).getName();
}
}

return null;
}

Expand Down

0 comments on commit 03c5a3d

Please sign in to comment.