New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize map inverse cell projections with capacity 1. #14440

Merged
merged 1 commit into from Dec 11, 2017
Commits on Nov 27, 2017
  1. Initialize map inverse cell projections with capacity 1.

    RoosterDragon committed Nov 22, 2017
    This prevents the capacity being set to 4 when the first item is added. For flat maps, the inverse projection will only ever be of size 1, thus this is sufficient capacity. For isometric maps, 1 is often sufficient, we only need more near height changes where the discontinuity means multiple cells may project back. We can pay for some reallocations to expand the size in these cases.
    
    On flat maps, this reduces the memory required by the backing array 4x.