mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Resolve "Avoid bad performance pattern involving Interger.parseInt"
This commit is contained in:
committed by
Michael Kamensky
parent
33e7cde2d6
commit
19c07f5bef
@@ -531,12 +531,10 @@ public final class CardRules implements ICardCharacteristics {
|
||||
public final ManaCostShard next() {
|
||||
final String unparsed = st.nextToken();
|
||||
// System.out.println(unparsed);
|
||||
try {
|
||||
int iVal = Integer.parseInt(unparsed);
|
||||
this.genericCost += iVal;
|
||||
if (StringUtils.isNumeric(unparsed)) {
|
||||
this.genericCost += Integer.parseInt(unparsed);
|
||||
return null;
|
||||
}
|
||||
catch (NumberFormatException nex) { }
|
||||
|
||||
return ManaCostShard.parseNonGeneric(unparsed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user