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); }
public PropertyInfoLinkedList() { Head = new PropertyInfoNode(); }