Jelajahi Sumber

Remove unnecessary normalization

Sam Cappleman-Lynes 7 tahun lalu
induk
melakukan
1e26bdde81
1 mengubah file dengan 2 tambahan dan 4 penghapusan
  1. 2 4
      bigint/src/biguint.rs

+ 2 - 4
bigint/src/biguint.rs

@@ -519,8 +519,7 @@ impl Div<BigUint> for BigDigit {
     type Output = BigUint;
 
     #[inline]
-    fn div(self, mut other: BigUint) -> BigUint {
-        other = other.normalize();
+    fn div(self, other: BigUint) -> BigUint {
         match other.data.len() {
             0 => panic!(),
             1 => From::from(self / other.data[0]),
@@ -557,8 +556,7 @@ impl Rem<BigUint> for BigDigit {
     type Output = BigUint;
 
     #[inline]
-    fn rem(self, mut other: BigUint) -> BigUint {
-        other = other.normalize();
+    fn rem(self, other: BigUint) -> BigUint {
         match other.data.len() {
             0 => panic!(),
             1 => From::from(self % other.data[0]),