All 1-character strings converted to primitives

"b" + "r" now changed to 'b' + 'w'.  It's more straight-forward, and may cause perfomance improvements - character primitives allocation is faster and less expensive than string creation.
This commit is contained in:
vraskulin 2017-01-27 15:57:10 +03:00
parent 31589778ca
commit f60ebfbb1f
451 changed files with 989 additions and 978 deletions

View file

@ -134,7 +134,7 @@ public class CardInfoWindowDialog extends MageDialog {
public void loadCards(ExileView exile, BigCard bigCard, UUID gameId) {
boolean changed = cards.loadCards(exile, bigCard, gameId, true);
String titel = name + " (" + exile.size() + ")";
String titel = name + " (" + exile.size() + ')';
setTitle(titel);
this.setTitelBarToolTip(titel);
if (exile.size() > 0) {

View file

@ -398,7 +398,7 @@ public class ConnectDialog extends MageDialog {
// pref settings
MageFrame.getInstance().setUserPrefsToConnection(connection);
logger.debug("connecting: " + connection.getProxyType() + " " + connection.getProxyHost() + " " + connection.getProxyPort());
logger.debug("connecting: " + connection.getProxyType() + ' ' + connection.getProxyHost() + ' ' + connection.getProxyPort());
task = new ConnectTask();
task.execute();
} finally {

View file

@ -100,7 +100,7 @@ public class GameEndDialog extends MageDialog {
StringBuilder sb = new StringBuilder();
for (PlayerView player : gameEndView.getPlayers()) {
sb.append(player.getName()).append(" Life: ").append(player.getLife()).append(" ");
sb.append(player.getName()).append(" Life: ").append(player.getLife()).append(' ');
}
this.txtLife.setText(sb.toString());
@ -128,8 +128,8 @@ public class GameEndDialog extends MageDialog {
sdf.applyPattern( "yyyyMMdd_HHmmss" );
String fileName = new StringBuilder(dir).append(File.separator)
.append(sdf.format(gameEndView.getStartTime()))
.append("_").append(gameEndView.getMatchView().getGameType())
.append("_").append(gameEndView.getMatchView().getGames().size())
.append('_').append(gameEndView.getMatchView().getGameType())
.append('_').append(gameEndView.getMatchView().getGames().size())
.append(".txt").toString();
PrintWriter out = new PrintWriter(fileName);
out.print(gamePanel.getGameLog());

View file

@ -673,7 +673,7 @@ public class NewTableDialog extends MageDialog {
StringBuilder playerTypesString = new StringBuilder();
for (Object player : players) {
if (playerTypesString.length() > 0) {
playerTypesString.append(",");
playerTypesString.append(',');
}
TablePlayerPanel tpp = (TablePlayerPanel) player;
playerTypesString.append(tpp.getPlayerType());

View file

@ -836,7 +836,7 @@ public class NewTournamentDialog extends MageDialog {
StringBuilder packList = new StringBuilder();
for (ExpansionInfo exp : allExpansions) {
packList.append(exp.getCode());
packList.append(";");
packList.append(';');
}
txtRandomPacks.setText(packList.toString());
}
@ -860,7 +860,7 @@ public class NewTournamentDialog extends MageDialog {
StringBuilder packList = new StringBuilder();
for (String str : randomPackSelector.getSelectedPacks()) {
packList.append(str);
packList.append(";");
packList.append(';');
}
this.txtRandomPacks.setText(packList.toString());
this.pack();
@ -1088,7 +1088,7 @@ public class NewTournamentDialog extends MageDialog {
StringBuilder packlist = new StringBuilder();
for (String pack : this.randomPackSelector.getSelectedPacks()){
packlist.append(pack);
packlist.append(";");
packlist.append(';');
}
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_PACKS_RANDOM_DRAFT, packlist.toString());
}