Add a new "move" source option for the /data modify command with the following syntax:
/data modify <target> (set|append|...) move <source>
The idea is that the value will automatically be removed from the source during the operation, so the contents won't need to be cloned like usual with the "from" source, increasing performance. This is important when working with big data structures, so they won't need to be cloned every time. Additionally, this can be used to filter out elements from a list to put into another list, e.g.:
/data modify storage example filtered append move storage example mylist[{a:42}]
This would move all values from mylist with a being equal to 42 into the filtered list.
Please sign in to leave a comment.
0 Comments