Adds a check to potentially save a few CPU cycles under certain circumstances.
@@ -290,6 +290,7 @@ public class Screen {
/** Draws all of the screen's tiles onto the canvas. */
public void draw() {
// Draw components on screen.
+ if (components.size() > 0) {
componentsLock.readLock().lock();
for (final Component component : components) {
@@ -297,6 +298,7 @@ public class Screen {
}
componentsLock.readLock().unlock();
+ }
// Draw screen on canvas.
final BufferStrategy bs = canvas.getBufferStrategy();
