public override bool Equals(Object other) { if (this == other) { return(true); } if (!base.Equals(other)) { return(false); } BranchHeadNode o = (BranchHeadNode)other; return(length == o.length && next == o.next); }
public override Node Register(StringTrieBuilder builder) { Node subNode = Register(builder, 0, chars.Length); BranchHeadNode head = new BranchHeadNode(chars.Length, subNode); Node result = head; if (hasValue) { if (builder.MatchNodesCanHaveValues) { head.SetValue(value); } else { result = new IntermediateValueNode(value, builder.RegisterNode(head)); } } return(builder.RegisterNode(result)); }