Fixes a bug in the getMatching method causing the input list to lose all matching elements
All checks were successful
KnarCraft/FFmpegConvert/pipeline/head This commit looks good

This commit is contained in:
2020-05-09 01:50:42 +02:00
parent f4afb63f32
commit 7f479fd760
2 changed files with 6 additions and 5 deletions

View File

@ -40,6 +40,7 @@ public final class ListUtil {
* @return <p>A new list containing all matching elements.</p>
*/
static <T> List<T> getMatching(List<T> list, Predicate<T> predicate) {
list = new ArrayList<>(list);
List<T> copy = new ArrayList<>(list);
list.removeIf(predicate);
copy.removeAll(list);