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