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

◆ ComputeMinLength()

int System.Text.RegularExpressions.RegexNode.ComputeMinLength ( )
inline

Definition at line 1342 of file RegexNode.cs.

1343 {
1344 return ComputeMinLength(this, 20u);
1345 static int ComputeMinLength(RegexNode node, uint maxDepth)
1346 {
1347 if (maxDepth == 0)
1348 {
1349 return 0;
1350 }
1351 switch (node.Type)
1352 {
1353 case 9:
1354 case 10:
1355 case 11:
1356 return 1;
1357 case 12:
1358 return node.Str.Length;
1359 case 3:
1360 case 4:
1361 case 5:
1362 case 6:
1363 case 7:
1364 case 8:
1365 case 43:
1366 case 44:
1367 case 45:
1368 return node.M;
1369 case 26:
1370 case 27:
1371 return (int)Math.Min(2147483647L, (long)node.M * (long)ComputeMinLength(node.Child(0), maxDepth - 1));
1372 case 24:
1373 {
1374 int num3 = node.ChildCount();
1375 int num4 = ComputeMinLength(node.Child(0), maxDepth - 1);
1376 for (int j = 1; j < num3; j++)
1377 {
1378 if (num4 <= 0)
1379 {
1380 break;
1381 }
1382 num4 = Math.Min(num4, ComputeMinLength(node.Child(j), maxDepth - 1));
1383 }
1384 return num4;
1385 }
1386 case 25:
1387 {
1388 long num = 0L;
1389 int num2 = node.ChildCount();
1390 for (int i = 0; i < num2; i++)
1391 {
1392 num += ComputeMinLength(node.Child(i), maxDepth - 1);
1393 }
1394 return (int)Math.Min(2147483647L, num);
1395 }
1396 case 28:
1397 case 29:
1398 case 32:
1399 return ComputeMinLength(node.Child(0), maxDepth - 1);
1400 default:
1401 return 0;
1402 }
1403 }
1404 }
RegexNode(int type, RegexOptions options)
Definition RegexNode.cs:23

References System.Text.RegularExpressions.RegexNode.ComputeMinLength(), System.Text.RegularExpressions.i, System.L, and System.Math.Min().

Referenced by System.Text.RegularExpressions.RegexNode.ComputeMinLength().