WikiFunctions.Diff._withPositionsOfInInterval C# (CSharp) Method

_withPositionsOfInInterval() private method

private _withPositionsOfInInterval ( IList aCollection, int start, int end ) : Hashtable
aCollection IList
start int
end int
return System.Collections.Hashtable
        private Hashtable _withPositionsOfInInterval(IList aCollection, int start, int end)
        {
            Hashtable d = new Hashtable(comparer);
            for (int index = start; index <= end; index++)
            {
                object element = aCollection[index];
                if (d.ContainsKey(element))
                {
                    IntList list = (IntList) d[element];
                    list.Add(index);
                }
                else
                {
                    IntList list = new IntList {index};
                    d[element] = list;
                }
            }

            foreach (IntList list in d.Values)
            {
                list.Reverse();
            }

            return d;
        }