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

◆ Visit< T >()

static ReadOnlyCollection< T > System.Linq.Expressions.ExpressionVisitor.Visit< T > ( ReadOnlyCollection< T > nodes,
Func< T, T > elementVisitor )
inlinestaticinherited

Definition at line 55 of file ExpressionVisitor.cs.

56 {
57 ContractUtils.RequiresNotNull(nodes, "nodes");
58 ContractUtils.RequiresNotNull(elementVisitor, "elementVisitor");
59 T[] array = null;
60 int i = 0;
61 for (int count = nodes.Count; i < count; i++)
62 {
63 T val = elementVisitor(nodes[i]);
64 if (array != null)
65 {
66 array[i] = val;
67 }
68 else if ((object)val != (object)nodes[i])
69 {
70 array = new T[count];
71 for (int j = 0; j < i; j++)
72 {
73 array[j] = nodes[j];
74 }
75 array[i] = val;
76 }
77 }
78 if (array == null)
79 {
80 return nodes;
81 }
83 }
static void RequiresNotNull(object value, string paramName)

References System.array, System.Linq.count, System.Collections.ObjectModel.ReadOnlyCollection< T >.Count, and System.Dynamic.Utils.ContractUtils.RequiresNotNull().