mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
std.mem.indexOfSentinel: eliminate unnecessary @ptrCast
it was always unnecessary but now it's illegal
This commit is contained in:
parent
2d9df0bb1a
commit
dca4c302dd
@ -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).?;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user