forked from External/mage
performance: improved CPU/memory usage with copy of cost's targets (related to #11285), added runtime check for wrong targets usage
This commit is contained in:
parent
d6c858ecaf
commit
ddc1ec8ef8
32 changed files with 173 additions and 107 deletions
|
|
@ -914,7 +914,7 @@ public abstract class AbilityImpl implements Ability {
|
|||
if (getModes().getMode() != null) {
|
||||
return getModes().getMode().getTargets();
|
||||
}
|
||||
return new Targets();
|
||||
return new Targets().withReadOnly();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -926,7 +926,7 @@ public abstract class AbilityImpl implements Ability {
|
|||
res.addAll(mode.getTargets());
|
||||
}
|
||||
}
|
||||
return res;
|
||||
return res.withReadOnly();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue