Archive eaglercraft-archive-resent-3-3-source (source, 1.8.8, clean)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package dev.resent.util.misc;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class FuncUtils {
|
||||
public static <T> boolean removeIf(Collection<T> collection, Predicate<T> pre) {
|
||||
boolean ret = false;
|
||||
Iterator<T> itr = collection.iterator();
|
||||
while (itr.hasNext()) {
|
||||
if (pre.test(itr.next())) {
|
||||
itr.remove();
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user