1
0

Remove unnecessary int to String conversion

This commit is contained in:
Victor 2014-10-25 16:53:44 +03:00
parent bd143b8a69
commit 4326c02fb2

View File

@ -25,7 +25,7 @@ public final class Wind {
public void drawInfo(Graphics2D g, FontMetrics metrics) {
final int speedPercent = (int) (Math.abs(speed) * 100d / MAX_WIND_STRENGTH);
final String value = String.valueOf(speedPercent);
final String value = Integer.toString(speedPercent);
final int valueWidth = metrics.stringWidth(value);
final int x = (WIDTH - valueWidth) / 2;
final int y = metrics.getHeight();
@ -36,7 +36,7 @@ public final class Wind {
} else if (speed > 0) {
g.drawString("", x + 2 * valueWidth, y);
}
g.drawString(String.valueOf(speedPercent), x, y);
g.drawString(value, x, y);
}
}