summaryrefslogtreecommitdiff
path: root/nbtheory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'nbtheory.cpp')
-rw-r--r--nbtheory.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/nbtheory.cpp b/nbtheory.cpp
index 852beb5..8689cea 100644
--- a/nbtheory.cpp
+++ b/nbtheory.cpp
@@ -440,7 +440,7 @@ bool FirstPrime(Integer &p, const Integer &max, const Integer &equiv, const Inte
else
pItr = primeTable;
- while (pItr < primeTable+primeTableSize && *pItr%mod != equiv)
+ while (pItr < primeTable+primeTableSize && !(*pItr%mod == equiv && (!pSelector || pSelector->IsAcceptable(*pItr))))
++pItr;
if (pItr < primeTable+primeTableSize)