protected ShaMapLeafNode GetLeaf(Hash256 id, bool invalidating) { int ix = id.Nibblet(this.depth); ShaMapNode existing = this.branches[ix]; if (invalidating) { this.Invalidate(); } if (existing == null) { return(null); } var node = existing as ShaMapLeafNode; if (node != null) { return(node); } return(((ShaMapInnerNode)existing).GetLeaf(id, invalidating)); }
protected void SetNode(int slot, ShaMapNode node) { this.slotBits = this.slotBits | (1 << slot); this.branches[slot] = node; }