Exemplo n.º 1
0
        private static PropertyInfo GetPropertyInfo(Dictionary <int, PropertyInfoLinkedList> dictionary, int key, ReadOnlySpan <byte> span)
        {
            if (!dictionary.TryGetValue(key, out PropertyInfoLinkedList value))
            {
                throw new KeyNotFoundException();
            }
            PropertyInfoNode node = value.Head;
            PropertyInfo     pi   = node.Value.propertyInfo;

            // This should be a very rare occurrence (only if there is hash collision)
            if (value.Count > 1)
            {
                while (node != null)
                {
                    if (span.SequenceEqual(node.Value.encodedName))
                    {
                        pi = node.Value.propertyInfo;
                        break;
                    }
                    node = node.Next;
                }
            }
            return(pi);
        }
Exemplo n.º 2
0
 public PropertyInfoLinkedList()
 {
     Head = new PropertyInfoNode();
 }