Exemple #1
0
        public int Compare(bool leftExists, ReadOnlySpan <byte> left, bool rightExists, ReadOnlySpan <byte> right)
        {
            sbyte leftValue  = leftExists ? ScalarSpanReader.ReadSByte(left) : this.defaultValue;
            sbyte rightValue = rightExists ? ScalarSpanReader.ReadSByte(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.ReadSByte(left).CompareTo(ScalarSpanReader.ReadSByte(right)));
        }
Exemple #3
0
 public override sbyte ReadSByte(int offset)
 {
     return(ScalarSpanReader.ReadSByte(this.memory.AsSpan().Slice(offset)));
 }
Exemple #4
0
 public int Compare(ReadOnlySpan <byte> left, ReadOnlySpan <byte> right)
 => ScalarSpanReader.ReadSByte(left).CompareTo(ScalarSpanReader.ReadSByte(right));