Refactor: Remove String Concatenation In Loop (#9217)

This commit is contained in:
DeepCrimson 2022-07-03 17:49:53 -04:00 committed by GitHub
parent 87908dc808
commit 6d4c422720
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -316,11 +316,11 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
// check commands
private void check(String checkName, int turnNum, PhaseStep step, TestPlayer player, String command, String... params) {
String res = CHECK_PREFIX + command;
StringBuilder res = new StringBuilder(CHECK_PREFIX + command);
for (String param : params) {
res += CHECK_PARAM_DELIMETER + param;
res.append(CHECK_PARAM_DELIMETER).append(param);
}
addPlayerAction(player, checkName, turnNum, step, res);
addPlayerAction(player, checkName, turnNum, step, res.toString());
}
/**