Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ TryGetValidSegmentLength()

static bool System.Net.NetworkInformation.PhysicalAddress.TryGetValidSegmentLength ( ReadOnlySpan< char > address,
char delimiter,
out int value )
inlinestaticprivate

Definition at line 201 of file PhysicalAddress.cs.

202 {
203 value = -1;
204 int num = 1;
205 int num2 = 0;
206 for (int i = 0; i < address.Length; i++)
207 {
208 if (address[i] == delimiter)
209 {
210 if (num2 == 0)
211 {
212 num2 = i;
213 }
214 else if ((i - (num - 1)) % num2 != 0)
215 {
216 return false;
217 }
218 num++;
219 }
220 }
221 if (num * num2 != 12)
222 {
223 return false;
224 }
225 value = num2;
226 return true;
227 }

References System.ReadOnlySpan< T >.Length, and System.value.

Referenced by System.Net.NetworkInformation.PhysicalAddress.TryParse().