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

◆ GetPrime() [2/2]

static int System.Collections.HashHelpers.GetPrime ( int min)
inlinestatic

Definition at line 34 of file HashHelpers.cs.

35 {
36 if (min < 0)
37 {
39 }
40 int[] array = s_primes;
41 foreach (int num in array)
42 {
43 if (num >= min)
44 {
45 return num;
46 }
47 }
48 for (int j = min | 1; j < int.MaxValue; j += 2)
49 {
50 if (IsPrime(j) && (j - 1) % 101 != 0)
51 {
52 return j;
53 }
54 }
55 return min;
56 }
static readonly int[] s_primes
Definition HashHelpers.cs:9
static bool IsPrime(int candidate)
static string Arg_HTCapacityOverflow
Definition SR.cs:186
Definition SR.cs:7

References System.SR.Arg_HTCapacityOverflow, System.array, System.Collections.HashHelpers.IsPrime(), and System.Collections.HashHelpers.s_primes.