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

@ -222,7 +222,7 @@ public class GuiDisplayUtil {
buffer.append("<tr><td valign='top'><b>");
buffer.append(card.getDisplayName());
if (card.isGameObject()) {
buffer.append(" [").append(card.getId().toString().substring(0, 3)).append("]");
buffer.append(" [").append(card.getId().toString().substring(0, 3)).append(']');
}
buffer.append("</b></td><td align='right' valign='top' style='width:");
buffer.append(symbolCount * GUISizeHelper.cardTooltipFontSize);
@ -232,7 +232,7 @@ public class GuiDisplayUtil {
}
buffer.append("</td></tr></table>");
buffer.append("<table cellspacing=0 cellpadding=0 border=0 width='100%'><tr><td style='margin-left: 1px'>");
String imageSize = " width=" + GUISizeHelper.cardTooltipFontSize + " height=" + GUISizeHelper.cardTooltipFontSize + ">";
String imageSize = " width=" + GUISizeHelper.cardTooltipFontSize + " height=" + GUISizeHelper.cardTooltipFontSize + '>';
if (card.getColor().isWhite()) {
buffer.append("<img src='").append(getResourcePath("card/color_ind_white.png")).append("' alt='W' ").append(imageSize);
}
@ -281,7 +281,7 @@ public class GuiDisplayUtil {
String pt = "";
if (CardUtil.isCreature(card)) {
pt = card.getPower() + "/" + card.getToughness();
pt = card.getPower() + '/' + card.getToughness();
} else if (CardUtil.isPlaneswalker(card)) {
pt = card.getLoyalty();
}
@ -291,7 +291,7 @@ public class GuiDisplayUtil {
buffer.append("<td align='right'>");
if (!card.isControlledByOwner()) {
if (card instanceof PermanentView) {
buffer.append("[").append(((PermanentView) card).getNameOwner()).append("] ");
buffer.append('[').append(((PermanentView) card).getNameOwner()).append("] ");
} else {
buffer.append("[only controlled] ");
}
@ -361,16 +361,16 @@ public class GuiDisplayUtil {
private static String getTypes(CardView card) {
String types = "";
for (String superType : card.getSuperTypes()) {
types += superType + " ";
types += superType + ' ';
}
for (CardType cardType : card.getCardTypes()) {
types += cardType.toString() + " ";
types += cardType.toString() + ' ';
}
if (card.getSubTypes().size() > 0) {
types += "- ";
}
for (String subType : card.getSubTypes()) {
types += subType + " ";
types += subType + ' ';
}
return types.trim();
}