From 90e0352a6701f2c21d6a9415a9e9452eb465a1d9 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Wed, 15 Oct 2014 21:55:59 -0700 Subject: [PATCH] Calculate size at the start, not every time --- src/forge/java/com/sk89q/worldedit/forge/NBTConverter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/forge/java/com/sk89q/worldedit/forge/NBTConverter.java b/src/forge/java/com/sk89q/worldedit/forge/NBTConverter.java index 04f8f8258..98f88c6e8 100644 --- a/src/forge/java/com/sk89q/worldedit/forge/NBTConverter.java +++ b/src/forge/java/com/sk89q/worldedit/forge/NBTConverter.java @@ -178,7 +178,8 @@ public static ListTag fromNative(NBTTagList other) { other = (NBTTagList) other.copy(); List list = new ArrayList(); Class listClass = StringTag.class; - for (int i = 0; i < other.tagCount(); i++) { + int tags = other.tagCount(); + for (int i = 0; i < tags; i++) { Tag child = fromNative(other.removeTag(0)); list.add(child); listClass = child.getClass();