Antmicro.Migrant.Utilities.SwapList.FindMatchingIndex C# (CSharp) Метод

FindMatchingIndex() публичный Метод

Finds the index of the delegate that matches given type.
public FindMatchingIndex ( Type value ) : int
value System.Type Type to match.
Результат int
        public int FindMatchingIndex(Type value)
        {
            var currentIndex = headIndex;
            while(currentIndex != -1)
            {
                var current = items[currentIndex];

                if(IsMatch(current.Key, value))
                {
                    if(current.Creator != null)
                    {
                        return InnerAddOrReplace(value, current.Creator(value), null);
                    }
                    return current.Value == null ? -1 : current.Id;
                }
                currentIndex = current.NextElementIndex;
            }
            return -1;
        }