Simplify and clarify bitmask calculation

This commit is contained in:
Nobuyoshi Nakada 2024-08-16 11:43:35 +09:00
parent 08db4bc672
commit 129b4936bf
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
Notes: git 2024-08-16 07:51:33 +00:00

View File

@ -103,7 +103,7 @@ redblack_value(redblack_node_t * node)
{
// Color is stored in the bottom bit of the shape pointer
// Mask away the bit so we get the actual pointer back
return (rb_shape_t *)((uintptr_t)node->value & (((uintptr_t)-1) - 1));
return (rb_shape_t *)((uintptr_t)node->value & ~(uintptr_t)1);
}
#ifdef HAVE_MMAP