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

◆ Remove()

T System.Diagnostics.DiagLinkedList< T >.Remove ( T value,
Func< T, T, bool > compare )
inline

Definition at line 78 of file DiagLinkedList.cs.

79 {
80 lock (this)
81 {
83 if (diagNode == null)
84 {
85 return default(T);
86 }
87 if (compare(diagNode.Value, value))
88 {
89 _first = diagNode.Next;
90 if (_first == null)
91 {
92 _last = null;
93 }
94 return diagNode.Value;
95 }
96 for (DiagNode<T> next = diagNode.Next; next != null; next = next.Next)
97 {
98 if (compare(next.Value, value))
99 {
100 diagNode.Next = next.Next;
101 if (_last == next)
102 {
103 _last = diagNode;
104 }
105 return next.Value;
106 }
107 diagNode = next;
108 }
109 return default(T);
110 }
111 }

References System.Diagnostics.DiagLinkedList< T >._first, System.Diagnostics.DiagLinkedList< T >._last, and System.value.