Closed mosirnik closed 1 year ago
If number of arrays is known why not use an array and id as index instead of a dictionary and id as key? It would eliminate the overhead.
Good point, changed to use an array instead. (Let me know if you prefer squash + force-push rather than adding new commits)
I'll most likely squash merge anyways so you can just push separate commits.
This patch caches the 1D and 2D temporary arrays created in UpdateVisible.
The transpiler is a little blunt, replacing all newarr instructions, so I included a check to ensure that we patch exactly 45 places. This should make it a little more robust against other plugins transpiling the same method.
I wrote some code (not included here) to check that all 45 arrays are indeed safe to cache.