diff --git a/btree.h b/btree.h index c7a977a..0abe101 100644 --- a/btree.h +++ b/btree.h @@ -574,9 +574,9 @@ class btree_node { btree_node* child(int i) const { return fields_.children[i]; } btree_node** mutable_child(int i) { return &fields_.children[i]; } void set_child(int i, btree_node *c) { - *mutable_child(i) = c; - c->fields_.parent = this; - c->fields_.position = i; + reinterpret_cast(this)->children[i] = c; + reinterpret_cast(c)->parent = this; + reinterpret_cast(c)->position = i; } // Returns the position of the first value whose key is not less than k.