Skip to content

Commit 82e8e68

Browse files
Fixed according to review comments
1 parent e19b6a3 commit 82e8e68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/internal_math.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl Barrett {
6060
let x = (((z as u128) * (self.im as u128)) >> 64) as u64;
6161
let mut v = (z - x * self._m as u64) as u32;
6262
if self._m <= v {
63-
v += self._m;
63+
v.wrapping_add(self._m);
6464
}
6565
v
6666
}
@@ -109,7 +109,7 @@ fn is_prime_constexpr(n: i32) -> bool {
109109
while d % 2 == 0 {
110110
d /= 2;
111111
}
112-
for a in [2, 7, 61].iter().copied() {
112+
for &a in &[2, 7, 61] {
113113
let mut t = d;
114114
let mut y = pow_mod_constexpr(a, t, n as i32);
115115
while t != n - 1 && y != 1 && y != n - 1 {

0 commit comments

Comments
 (0)