style: include SPP_USE_ISEMPTY (#5238)

This commit is contained in:
Piotr Idzik
2024-06-24 10:49:50 +02:00
committed by GitHub
parent 22f2abd94f
commit a710fe11c4
4 changed files with 5 additions and 8 deletions

View File

@ -31,7 +31,7 @@ public final class QuickSelect {
public static <T extends Comparable<T>> T select(List<T> list, int n) {
Objects.requireNonNull(list, "The list of elements must not be null.");
if (list.size() == 0) {
if (list.isEmpty()) {
String msg = "The list of elements must not be empty.";
throw new IllegalArgumentException(msg);
}