示例#1
0
        private uint LoadCount()
        {
            // this is an incorrect binary search approach
            // that will fail if any of the leaves are zero hashes
            // we should read count from the corresponding contract

            ulong left     = GetMinNodeIndex(LeafRow);
            ulong right    = GetMaxNodeIndex(LeafRow);
            ulong?topIndex = Binary.Search(left, right, ni => !ZeroHash.Equals(LoadValue(new Index(ni))));

            if (!topIndex.HasValue)
            {
                return(0);
            }

            return(new Index(topIndex.Value).IndexAtRow + 1);
        }
示例#2
0
 private bool Equals(SpecificTopic other) => _topic.Equals(other._topic);