| ... | ... | @@ -23,6 +23,12 @@ pub fn MultiArrayList(comptime T: type) type { |
| 23 | 23 | len: usize = 0, |
| 24 | 24 | capacity: usize = 0, |
| 25 | 25 | |
| 26 | pub const empty: Self = .{ |
| 27 | .bytes = undefined, |
| 28 | .len = 0, |
| 29 | .capacity = 0, |
| 30 | }; |
| 31 | |
| 26 | 32 | const Elem = switch (@typeInfo(T)) { |
| 27 | 33 | .@"struct" => T, |
| 28 | 34 | .@"union" => |u| struct { |
| ... | ... | @@ -474,7 +480,7 @@ pub fn MultiArrayList(comptime T: type) type { |
| 474 | 480 | pub fn swap(sc: @This(), a_index: usize, b_index: usize) void { |
| 475 | 481 | inline for (fields, 0..) |field_info, i| { |
| 476 | 482 | if (@sizeOf(field_info.type) != 0) { |
| 477 | | const field = @as(Field, @enumFromInt(i)); |
| 483 | const field: Field = @enumFromInt(i); |
| 478 | 484 | const ptr = sc.slice.items(field); |
| 479 | 485 | mem.swap(field_info.type, &ptr[a_index], &ptr[b_index]); |
| 480 | 486 | } |