Re:When Zig is safer and faster than Rust
by tialaramex on Tuesday March 07, 2023 @08:02PM
(#35063783)
You can use map() to turn an array of tuples into an array of structures. Unfortunately at time of writing the optimiser doesn't do a great job on this, so if you're making an array of several thousand of something, or an array of things which are themselves very large, this might have unacceptable performance, but in cases where I have say a modest N values and I want N structures based on those values...
[I have not actually compiled this code, but it should do roughly what you meant]
[ Parent
| on HN ]
There are no comments on this comment yet.