Commit Graph
1 Commits
Author SHA1 Message Date
242de3fe73 Don't sort children on node addition to save on performance (#68)
* Use a Tree Map for children to save on performance

Everytime a child is added to the CommandNode, the children was sorted.
This action is extremely heavy with large node trees such as Minecraft.

From what I can see, sort order was not even needed by type since
the dispatcher parse checks argument and literal nodes instead.

Testing on /bossbar command seemed to have no impact to behavior.

Credit to https://github.com/PaperMC/Paper/commit/dda9680be520bba8cc8b4a20072af42bd8420e7a

Co-authored-by: virustotalop <[email protected]>

* Restore back to a LinkedHashMap

since iteration order isn't important anyways.

Co-authored-by: virustotalop <[email protected]>
2021-03-18 15:36:43 +01:00