コード例 #1
0
        public int Compare(bool leftExists, ReadOnlySpan <byte> left, bool rightExists, ReadOnlySpan <byte> right)
        {
            int leftValue  = leftExists ? ScalarSpanReader.ReadInt(left) : this.defaultValue;
            int rightValue = rightExists ? ScalarSpanReader.ReadInt(right) : this.defaultValue;

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

            return(ScalarSpanReader.ReadInt(left).CompareTo(ScalarSpanReader.ReadInt(right)));
        }
コード例 #3
0
 public override int ReadInt(int offset)
 {
     CheckAlignment(offset, sizeof(int));
     return(ScalarSpanReader.ReadInt(this.memory.AsSpan().Slice(offset)));
 }
コード例 #4
0
 public int Compare(ReadOnlySpan <byte> left, ReadOnlySpan <byte> right)
 => ScalarSpanReader.ReadInt(left).CompareTo(ScalarSpanReader.ReadInt(right));
コード例 #5
0
ファイル: ArrayInputBuffer.cs プロジェクト: jafin/FlatSharp
 public override int ReadInt(int offset)
 {
     return(ScalarSpanReader.ReadInt(this.memory.AsSpan().Slice(offset)));
 }