Skip to content

Commit

Permalink
fix for robovm compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Ski committed May 24, 2024
1 parent 96ec632 commit fe14e51
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.badlogic.gdx.utils.GdxRuntimeException;

import java.util.Collection;
import java.util.function.Predicate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand All @@ -29,8 +28,12 @@ public static String getNewName (String newNameAttempt, Collection<String> poten
}
Pattern duplicatePattern = Pattern.compile(newNameAttempt + "\\([0-9]*\\)$");

Predicate<String> predicate = duplicatePattern.asPredicate();
long count = potentialConflicts.stream().filter(predicate).count();
long count = 0;
for (String potentialConflict : potentialConflicts) {
if (duplicatePattern.matcher(potentialConflict).find()) {
count++;
}
}

if (count > 0) {
//We have things that match our regex
Expand Down

0 comments on commit fe14e51

Please sign in to comment.