Skip to content
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

Change functions returning vecs to global arrays. #340

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

benjamin051000
Copy link
Contributor

@benjamin051000 benjamin051000 commented Jan 26, 2025

I'm not sure why these were initally functions. I think they are better off as global arrays, since the function would initialize a new vec every time its called, whereas this only initializes it once.

TODO

  • Test: I tested it with one small section of a city and it appears to work. I wouldn't by any means call this thoroughly-tested.

I'm not sure why these were initally functions. I think they are better
off as global arrays, since the function would initialize a new vec
every time its called, whereas this only initializes it once.
QUARTZ_BRICKS,
]
}
pub static BUILDING_CORNER_VARIATIONS: [Block; 20] = [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be worth considering making these const instead of static, but I'm not sure. In the future, someone can see if it makes a performance difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant