Hopefully this should increase performance a bit

This method is a bottleneck :(
This commit is contained in:
Acrobot 2013-02-08 21:35:23 +01:00
parent 79bf52c312
commit ffbaaf85ed

View File

@ -70,7 +70,7 @@ public class MaterialUtil {
for (Material currentMaterial : Material.values()) {
String matName = currentMaterial.name();
if (matName.replace("_", "").startsWith(name) && matName.length() < length) {
if (matName.length() < length && matName.replace("_", "").startsWith(name)) {
length = (short) matName.length();
material = currentMaterial;
}