示例#1
0
        internal static bool GetStringEquals(SingleByteStringStorageSegment segment1, int start1, SingleByteStringStorageSegment segment2, int start2)
        {
            // Include the header in the comparison, so different length strings are detected early when comparing the length bytes
            int  length = HeaderLength + segment1.GetStringLength(start1);
            bool result = true;

            for (int i = 0; i < length; i++)
            {
                if (segment1._data[start1 + i] !=
                    segment2._data[start2 + i])
                {
                    result = false;
                    break;
                }
            }
            return(result);
        }
示例#2
0
 public bool Equals(SingleByteString other) => SingleByteStringStorageSegment.GetStringEquals(Segment, Start, other.Segment, other.Start);
示例#3
0
 internal SingleByteString(SingleByteStringStorageSegment segment, int start)
 {
     Segment = segment;
     Start   = start;
 }
 private void CreateNewCurrentSegment()
 {
     _currentSegment = new SingleByteStringStorageSegment(Options);
     _segments.Add(_currentSegment);
 }