authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-09-07 20:23:19-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-09-07 20:23:36-07:00
logdca4c302dd323f093c53b354ad64d504ed7a2dea
tree00fb4800d0d1a12f3f7c6c276697d60357f03908
parent2d9df0bb1a79267b4bc6b91125d4d2eebc31bc26

std.mem.indexOfSentinel: eliminate unnecessary `@ptrCast`

it was always unnecessary but now it's illegal

1 files changed, 3 insertions(+), 3 deletions(-)

lib/std/mem.zig+3-3
......@@ -1156,10 +1156,10 @@ pub fn indexOfSentinel(comptime T: type, comptime sentinel: T, p: [*:sentinel]co
11561156 }
11571157 }
11581158
1159 assert(std.mem.isAligned(@intFromPtr(&p[i]), block_size));
1159 std.debug.assertAligned(&p[i], .fromByteUnits(block_size));
11601160 while (true) {
1161 const block: *const Block = @ptrCast(@alignCast(p[i..][0..block_len]));
1162 const matches = block.* == mask;
1161 const block: Block = p[i..][0..block_len].*;
1162 const matches = block == mask;
11631163 if (@reduce(.Or, matches)) {
11641164 return i + std.simd.firstTrue(matches).?;
11651165 }