Merge pull request #8983 from WilliamCollishaw/remove-redundant-substring-endIndex
Remove redundant subString endindex .length() calls
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user