| ... | ... | @@ -280,8 +280,7 @@ pub fn Custom( |
| 280 | 280 | if (it.index >= it.len) return null; |
| 281 | 281 | const result = Entry{ |
| 282 | 282 | .key_ptr = &it.keys[it.index], |
| 283 | | // workaround for #6974 |
| 284 | | .value_ptr = if (@sizeOf(*V) == 0) undefined else &it.values[it.index], |
| 283 | .value_ptr = &it.values[it.index], |
| 285 | 284 | }; |
| 286 | 285 | it.index += 1; |
| 287 | 286 | return result; |
| ... | ... | @@ -323,8 +322,7 @@ pub fn Custom( |
| 323 | 322 | const slice = self.entries.slice(); |
| 324 | 323 | return GetOrPutResult{ |
| 325 | 324 | .key_ptr = &slice.items(.key)[index], |
| 326 | | // workaround for #6974 |
| 327 | | .value_ptr = if (@sizeOf(*V) == 0) undefined else &slice.items(.value)[index], |
| 325 | .value_ptr = &slice.items(.value)[index], |
| 328 | 326 | .found_existing = true, |
| 329 | 327 | .index = index, |
| 330 | 328 | }; |
| ... | ... | @@ -369,8 +367,7 @@ pub fn Custom( |
| 369 | 367 | if (hashes_array[i] == h and checkedEql(ctx, key, item_key.*, i)) { |
| 370 | 368 | return GetOrPutResult{ |
| 371 | 369 | .key_ptr = item_key, |
| 372 | | // workaround for #6974 |
| 373 | | .value_ptr = if (@sizeOf(*V) == 0) undefined else &slice.items(.value)[i], |
| 370 | .value_ptr = &slice.items(.value)[i], |
| 374 | 371 | .found_existing = true, |
| 375 | 372 | .index = i, |
| 376 | 373 | }; |
| ... | ... | @@ -383,8 +380,7 @@ pub fn Custom( |
| 383 | 380 | |
| 384 | 381 | return GetOrPutResult{ |
| 385 | 382 | .key_ptr = &keys_array.ptr[index], |
| 386 | | // workaround for #6974 |
| 387 | | .value_ptr = if (@sizeOf(*V) == 0) undefined else &slice.items(.value).ptr[index], |
| 383 | .value_ptr = &slice.items(.value).ptr[index], |
| 388 | 384 | .found_existing = false, |
| 389 | 385 | .index = index, |
| 390 | 386 | }; |
| ... | ... | @@ -569,8 +565,7 @@ pub fn Custom( |
| 569 | 565 | const slice = self.entries.slice(); |
| 570 | 566 | return Entry{ |
| 571 | 567 | .key_ptr = &slice.items(.key)[index], |
| 572 | | // workaround for #6974 |
| 573 | | .value_ptr = if (@sizeOf(*V) == 0) undefined else &slice.items(.value)[index], |
| 568 | .value_ptr = &slice.items(.value)[index], |
| 574 | 569 | }; |
| 575 | 570 | } |
| 576 | 571 | |
| ... | ... | @@ -634,8 +629,7 @@ pub fn Custom( |
| 634 | 629 | } |
| 635 | 630 | pub fn getPtrAdapted(self: Self, key: anytype, ctx: anytype) ?*V { |
| 636 | 631 | const index = self.getIndexAdapted(key, ctx) orelse return null; |
| 637 | | // workaround for #6974 |
| 638 | | return if (@sizeOf(*V) == 0) @as(*V, undefined) else &self.values()[index]; |
| 632 | return &self.values()[index]; |
| 639 | 633 | } |
| 640 | 634 | |
| 641 | 635 | /// Find the actual key associated with an adapted key |
| ... | ... | @@ -1314,8 +1308,7 @@ pub fn Custom( |
| 1314 | 1308 | return .{ |
| 1315 | 1309 | .found_existing = false, |
| 1316 | 1310 | .key_ptr = &keys_array.ptr[new_index], |
| 1317 | | // workaround for #6974 |
| 1318 | | .value_ptr = if (@sizeOf(*V) == 0) undefined else &values_array.ptr[new_index], |
| 1311 | .value_ptr = &values_array.ptr[new_index], |
| 1319 | 1312 | .index = new_index, |
| 1320 | 1313 | }; |
| 1321 | 1314 | } |
| ... | ... | @@ -1328,8 +1321,7 @@ pub fn Custom( |
| 1328 | 1321 | return .{ |
| 1329 | 1322 | .found_existing = true, |
| 1330 | 1323 | .key_ptr = &keys_array[slot_data.entry_index], |
| 1331 | | // workaround for #6974 |
| 1332 | | .value_ptr = if (@sizeOf(*V) == 0) undefined else &values_array[slot_data.entry_index], |
| 1324 | .value_ptr = &values_array[slot_data.entry_index], |
| 1333 | 1325 | .index = slot_data.entry_index, |
| 1334 | 1326 | }; |
| 1335 | 1327 | } |
| ... | ... | @@ -1370,8 +1362,7 @@ pub fn Custom( |
| 1370 | 1362 | return .{ |
| 1371 | 1363 | .found_existing = false, |
| 1372 | 1364 | .key_ptr = &keys_array.ptr[new_index], |
| 1373 | | // workaround for #6974 |
| 1374 | | .value_ptr = if (@sizeOf(*V) == 0) undefined else &values_array.ptr[new_index], |
| 1365 | .value_ptr = &values_array.ptr[new_index], |
| 1375 | 1366 | .index = new_index, |
| 1376 | 1367 | }; |
| 1377 | 1368 | } |