Calculate size at the start, not every time

This commit is contained in:
Kenzie Togami 2014-10-15 21:55:59 -07:00
parent 82a352fcc2
commit 90e0352a67

View File

@ -178,7 +178,8 @@ final class NBTConverter {
other = (NBTTagList) other.copy();
List<Tag> list = new ArrayList<Tag>();
Class<? extends Tag> 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();