Remove redundant subString endindex .length() calls
This commit is contained in:
@@ -116,7 +116,7 @@ public class FlatStorage implements Storage
|
||||
{
|
||||
int lidx = line.indexOf('=');
|
||||
String key = line.substring(0, lidx);
|
||||
String value = line.substring(lidx + 1, line.length());
|
||||
String value = line.substring(lidx + 1);
|
||||
|
||||
if ("file".equals(key))
|
||||
{
|
||||
@@ -128,7 +128,7 @@ public class FlatStorage implements Storage
|
||||
int vidx = value.indexOf('=');
|
||||
FileData fd = new FileData();
|
||||
fd.setId(Integer.parseInt(value.substring(0, vidx)));
|
||||
fd.setNameHash(Integer.parseInt(value.substring(vidx + 1, value.length())));
|
||||
fd.setNameHash(Integer.parseInt(value.substring(vidx + 1)));
|
||||
fileData.add(fd);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -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