Remove unnecessary if statements

This commit is contained in:
Henry de Valence 2017-04-02 23:17:20 +02:00
parent e74bf8e789
commit b3041f2adc
2 changed files with 2 additions and 14 deletions

View file

@ -470,13 +470,7 @@ pub trait IsIdentity {
/// constructor. /// constructor.
impl<T> IsIdentity for T where T: CTEq + Identity { impl<T> IsIdentity for T where T: CTEq + Identity {
fn is_identity(&self) -> bool { fn is_identity(&self) -> bool {
let identity: T = T::identity(); self.ct_eq(&T::identity()) == 1u8
if self.ct_eq(&identity) == 1u8 {
return true;
} else {
return false;
}
} }
} }

View file

@ -72,13 +72,7 @@ impl PartialEq for Scalar {
/// ///
/// True if they are equal, and false otherwise. /// True if they are equal, and false otherwise.
fn eq(&self, other: &Self) -> bool { fn eq(&self, other: &Self) -> bool {
let equal: u8 = arrays_equal_ct(&self.0, &other.0); arrays_equal_ct(&self.0, &other.0) == 1u8
if equal == 1u8 {
return true;
} else {
return false;
}
} }
} }