![Image](https://forums.factorio.com/images/ext/0f2217e6c190d13696592ec16c33886c.png)
Thanks,
As the only one who cares about sorting is the user you don't need to sort chests that the user doesn't open.Xynariz wrote: Fri Jun 28, 2019 5:22 pm I do see a potential issue with very large modded inventories, as by definition, sorting is at minimum an n log(n) operation. Maybe if an inventory is above X size, it will only combine partial stacks and move stacks forwards?
Also sorting probably shouldn't happen automatically at all. I was thinking of a little "sort" button in the open chest dialog that you press to sort and merge items. At least merging stacks of item where possible would change the behavior of the chest and needs to remain a manual thing.eradicator wrote: Fri Jun 28, 2019 5:39 pm LuaInventory.sort_and_merge()
As the only one who cares about sorting is the user you don't need to sort chests that the user doesn't open.Xynariz wrote: Fri Jun 28, 2019 5:22 pm I do see a potential issue with very large modded inventories, as by definition, sorting is at minimum an n log(n) operation. Maybe if an inventory is above X size, it will only combine partial stacks and move stacks forwards?