mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-26 05:59:22 +08:00
style: include SPP_USE_ISEMPTY
(#5238)
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user