private bool LastIndexOfLoop(T item, ref long count, ref ISegment <T> segment, ref int segmentIndex, ref int elementStartIndex, ref long itemIndex, ref long result)
        {
            int CompareCount = (elementStartIndex < count) ? elementStartIndex + 1 : (int)count;
            int ElementIndex = segment.LastIndexOf(item, elementStartIndex, CompareCount);

            if (ElementIndex >= 0)
            {
                result = itemIndex - elementStartIndex + ElementIndex;
                return(true);
            }

            count     -= CompareCount;
            itemIndex -= CompareCount;
            segmentIndex--;

            Debug.Assert(segmentIndex < 0 || SegmentTable[segmentIndex].Count > 0);

            if (segmentIndex < 0 || count == 0)
            {
                return(true);
            }

            segment           = SegmentTable[segmentIndex];
            elementStartIndex = segment.Count - 1;

            return(false);
        }