Exemple #1
0
        public int Compare(bool leftExists, ReadOnlySpan <byte> left, bool rightExists, ReadOnlySpan <byte> right)
        {
            ulong leftValue  = leftExists ? ScalarSpanReader.ReadULong(left) : this.defaultValue;
            ulong rightValue = rightExists ? ScalarSpanReader.ReadULong(right) : this.defaultValue;

            return(leftValue.CompareTo(rightValue));
        }
Exemple #2
0
        public int Compare(bool leftExists, ReadOnlySpan <byte> left, bool rightExists, ReadOnlySpan <byte> right)
        {
            if (!leftExists || !rightExists)
            {
                return(leftExists.CompareTo(rightExists));
            }

            return(ScalarSpanReader.ReadULong(left).CompareTo(ScalarSpanReader.ReadULong(right)));
        }
Exemple #3
0
 public override ulong ReadULong(int offset)
 {
     CheckAlignment(offset, sizeof(ulong));
     return(ScalarSpanReader.ReadULong(this.memory.AsSpan().Slice(offset)));
 }
Exemple #4
0
 public int Compare(ReadOnlySpan <byte> left, ReadOnlySpan <byte> right)
 => ScalarSpanReader.ReadULong(left).CompareTo(ScalarSpanReader.ReadULong(right));
Exemple #5
0
 public override ulong ReadULong(int offset)
 {
     return(ScalarSpanReader.ReadULong(this.memory.AsSpan().Slice(offset)));
 }