From af88ad6e40366bd5501f2929b3018cdac8cb75c4 Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Thu, 4 Feb 2021 02:00:21 +0100 Subject: [PATCH] Improve RenderTask code-style --- .../bluemap/common/RenderTask.java | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderTask.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderTask.java index 49e91995..dddcdb17 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderTask.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderTask.java @@ -24,27 +24,22 @@ */ package de.bluecolored.bluemap.common; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.util.ArrayDeque; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Deque; -import java.util.List; -import java.util.UUID; - import com.flowpowered.math.vector.Vector2d; import com.flowpowered.math.vector.Vector2i; import com.flowpowered.math.vector.Vector3i; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.*; + public class RenderTask { private final UUID uuid; - private String name; + private final String name; private final MapType mapType; - private Deque renderTiles; + private final Deque renderTiles; private long firstTileTime; private long additionalRunTime; @@ -92,14 +87,12 @@ public void optimizeQueue(Vector2i centerBlockPos) { if (v1.getY() > v2.getY()) return 1; if (v1.getX() < v2.getX()) return -1; if (v1.getX() > v2.getX()) return 1; - + return 0; }); renderTiles.clear(); - for (Vector2i tile : tileList) { - renderTiles.add(tile); - } + renderTiles.addAll(tileList); } }