Performance improvements

This commit is contained in:
Marcel Konrad
2018-07-01 13:30:42 +02:00
parent d8d63ed959
commit 4b865d6861

View File

@@ -270,6 +270,7 @@ public class GuiWorldHandlerContainer extends Container
@Override @Override
protected void actionPerformed(GuiButton button) throws IOException protected void actionPerformed(GuiButton button) throws IOException
{ {
buttons:
switch(button.id) switch(button.id)
{ {
case 1: case 1:
@@ -334,14 +335,13 @@ public class GuiWorldHandlerContainer extends Container
} }
break; break;
default: default:
elements: for(IElement element : this.elements)
for(IElement element : this.elements) {
if(element.actionPerformed(this, button))
{ {
if(element.actionPerformed(this, button)) break buttons;
{
break elements;
}
} }
}
this.content.actionPerformed(this, button); this.content.actionPerformed(this, button);
break; break;
} }