3 ms·
>In the multi-sequence for loop version it’s only necessary to test once at the beginning of the loop that the two arrays have equal size, instead of having 2 a
by noobermin 4y ago
>In the multi-sequence for loop version it’s only necessary to test once at the beginning of the loop that the two arrays have equal size, instead of having 2 assertions run every loop iteration.
So, I'm assuming zig generally cannot be used with multi-threaded code? Can the underlying arrays not be modified during the whole loop execution?
- int_19h 4y agoArrays can be modified, but their size is a part of their type, just like C. For slices, length is only known at runtime, but it's immutable once the slice is created, so there's no issue there, either.
- deleted 4y ago[deleted]
- masklinn 4y agoThat's broken in every language, except for the few which just don't allow doing it. So I'm not quite sure what the question is about.