Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-225425

"/data modify" inserts source elements into target collection one by one

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Resolution: Unresolved
    • 1.16.5, 21w19a, 1.17 Pre-release 1, 1.17, 1.17.1, 21w37a
    • None
    • Confirmed
    • (Unassigned)

    Description

      The bug

      /data modify ... insert|prepend|append ... inserts the source elements into the target collection one by one, not in batches. Because the internal collection of list tags and array tags are java.util.ArrayList and primitive arrays respectively, this way of insertion slows down performance by repeated unnecessary resizing of the target collection.

      This will be resolved by usingĀ java.util.ArrayList#addAll and org.apache.commons.lang3.ArrayUtils#addAll instead of java.util.ArrayList#add and org.apache.commons.lang3.ArrayUtils#add, respectively.

      Partially related to MC-221421.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              intsuc intsuc
              Votes:
              7 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                CHK: