Change functions returning vecs to global arrays.#340
Conversation
c891468 to
9b46bc8
Compare
| QUARTZ_BRICKS, | ||
| ] | ||
| } | ||
| pub static BUILDING_CORNER_VARIATIONS: [Block; 20] = [ |
There was a problem hiding this comment.
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.
8af2e3b to
9b46bc8
Compare
Both approaches look good to me and seem to be a better implementation compared to the current state. Would you prefer #351 over this one? There isn't any time pressure from my side since the next release still needs a few more feature merges, so we could work on finishing #351. Having a better solution than the constant required unwrap calls would be great, like you already mentioned. Really cool work and documentation from your side btw 😎 |
|
#351 is definitely the preferred thing to do, so merge this or close it, I don't have a preference |
9b46bc8 to
d4f5d53
Compare
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.
d4f5d53 to
bfba692
Compare
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