mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Avoid double look up in map.
This commit is contained in:
@@ -116,10 +116,11 @@ public final class AbilityFactory {
|
||||
public static Cost parseAbilityCost(final Card hostCard, Map<String, String> mapParams, AbilityRecordType type) {
|
||||
Cost abCost = null;
|
||||
if (type != AbilityRecordType.SubAbility) {
|
||||
if (!mapParams.containsKey("Cost")) {
|
||||
String cost = mapParams.get("Cost");
|
||||
if (cost == null) {
|
||||
throw new RuntimeException("AbilityFactory : getAbility -- no Cost in " + hostCard.getName());
|
||||
}
|
||||
abCost = new Cost(mapParams.get("Cost"), type == AbilityRecordType.Ability);
|
||||
abCost = new Cost(cost, type == AbilityRecordType.Ability);
|
||||
}
|
||||
return abCost;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user