From dca4c302dd323f093c53b354ad64d504ed7a2dea Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 7 Sep 2025 20:23:19 -0700 Subject: std.mem.indexOfSentinel: eliminate unnecessary `@ptrCast` it was always unnecessary but now it's illegal --- lib/std/mem.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/std') diff --git a/lib/std/mem.zig b/lib/std/mem.zig index e31e93aae1..8ca34aa51c 100644 --- a/lib/std/mem.zig +++ b/lib/std/mem.zig @@ -1156,10 +1156,10 @@ pub fn indexOfSentinel(comptime T: type, comptime sentinel: T, p: [*:sentinel]co } } - assert(std.mem.isAligned(@intFromPtr(&p[i]), block_size)); + std.debug.assertAligned(&p[i], .fromByteUnits(block_size)); while (true) { - const block: *const Block = @ptrCast(@alignCast(p[i..][0..block_len])); - const matches = block.* == mask; + const block: Block = p[i..][0..block_len].*; + const matches = block == mask; if (@reduce(.Or, matches)) { return i + std.simd.firstTrue(matches).?; } -- cgit v1.2.3