diff --git a/src/handles/global-handles.cc b/src/handles/global-handles.cc index 57a2e1901f..1782514d6e 100644 --- a/src/handles/global-handles.cc +++ b/src/handles/global-handles.cc @@ -80,9 +80,8 @@ class GlobalHandles::NodeBlock final { template const GlobalHandles::NodeBlock* GlobalHandles::NodeBlock::From(const NodeType* node) { - uintptr_t ptr = reinterpret_cast(node) - - sizeof(NodeType) * node->index(); - const BlockType* block = reinterpret_cast(ptr); + const NodeType* firstNode = node - node->index(); + const BlockType* block = reinterpret_cast(firstNode); DCHECK_EQ(node, block->at(node->index())); return block; } @@ -90,9 +89,8 @@ GlobalHandles::NodeBlock::From(const NodeType* node) { template GlobalHandles::NodeBlock* GlobalHandles::NodeBlock::From( NodeType* node) { - uintptr_t ptr = - reinterpret_cast(node) - sizeof(NodeType) * node->index(); - BlockType* block = reinterpret_cast(ptr); + NodeType* firstNode = node - node->index(); + BlockType* block = reinterpret_cast(firstNode); DCHECK_EQ(node, block->at(node->index())); return block; }