createLookupKey -> calcAttrListenerKey

This commit is contained in:
Halil Durak
2026-01-29 22:37:59 +03:00
parent f83b0b2d28
commit ef1bb7f519

View File

@@ -163,12 +163,12 @@ pub fn calcAttrListenerKey(self: *Element, event_type: KnownListener) AttrListen
// its size and alignment, though.
const target = self.asEventTarget();
// Check if we have 3 bits available from alignment of 8.
lp.assert(@alignOf(@TypeOf(target)) == 8, "createLookupKey: incorrect alignment", .{
lp.assert(@alignOf(@TypeOf(target)) == 8, "calcAttrListenerKey: incorrect alignment", .{
.event_target_alignment = @alignOf(@TypeOf(target)),
});
const ptr = @intFromPtr(target) >> 3;
lp.assert(ptr < (1 << 57), "createLookupKey: pointer overflow", .{ .ptr = ptr });
lp.assert(ptr < (1 << 57), "calcAttrListenerKey: pointer overflow", .{ .ptr = ptr });
return ptr | (@as(u64, @intFromEnum(event_type)) << 57);
}