Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CommonNode< T >()

static T System.Linq.Expressions.Interpreter.LabelInfo.CommonNode< T > ( T first,
T second,
Func< T, T > parent )
inlinestaticpackage
Type Constraints
T :class 

Definition at line 177 of file LabelInfo.cs.

177 : class
178 {
179 EqualityComparer<T> @default = EqualityComparer<T>.Default;
180 if (@default.Equals(first, second))
181 {
182 return first;
183 }
184 HashSet<T> hashSet = new HashSet<T>(@default);
185 for (T val = first; val != null; val = parent(val))
186 {
187 hashSet.Add(val);
188 }
189 for (T val2 = second; val2 != null; val2 = parent(val2))
190 {
191 if (hashSet.Contains(val2))
192 {
193 return val2;
194 }
195 }
196 return null;
197 }
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Collections.Generic.Dictionary< TKey, TValue >.Contains(), System.Linq.first, and System.Linq.second.