summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-08-16 11:43:35 +0900
committerNobuyoshi Nakada <[email protected]>2024-08-16 15:43:43 +0900
commit129b4936bf8c556e9d400852ccd5b165dbe91499 (patch)
tree3780de5d5ff10a57f0fbf0e6c2378d2abbe9934a
parent08db4bc672eea0426c786ceece3545ac44eccad6 (diff)
Simplify and clarify bitmask calculation
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11389
-rw-r--r--shape.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shape.c b/shape.c
index 0200a6e526..f9e8b31861 100644
--- a/shape.c
+++ b/shape.c
@@ -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