Remove redundant subString endindex .length() calls

This commit is contained in:
William Collishaw
2019-06-01 13:19:15 -06:00
parent 82711a6d35
commit 531546e3a0
3 changed files with 5 additions and 5 deletions

View File

@@ -111,7 +111,7 @@ public enum Runes
public String getName()
{
String name = this.name();
name = name.substring(0, 1) + name.substring(1, name.length()).toLowerCase();
name = name.substring(0, 1) + name.substring(1).toLowerCase();
return name;
}
}

View File

@@ -154,7 +154,7 @@ public class TooltipComponent implements RenderableEntity
// Draw trailing text (after last tag)
final TextComponent textComponent = new TextComponent();
textComponent.setColor(nextColor);
textComponent.setText(line.substring(begin, line.length()));
textComponent.setText(line.substring(begin));
textComponent.setPosition(new Point(lineX, textY + (i + 1) * textHeight - textDescent));
textComponent.render(graphics);
}
@@ -194,7 +194,7 @@ public class TooltipComponent implements RenderableEntity
}
// Include trailing text (after last tag)
textWidth += metrics.stringWidth(line.substring(begin, line.length()));
textWidth += metrics.stringWidth(line.substring(begin));
return textWidth;
}