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.
impl<T> IsIdentity for T where T: CTEq + Identity {
fn is_identity(&self) -> bool {
let identity: T = T::identity();
if self.ct_eq(&identity) == 1u8 {
return true;
} else {
return false;
}
self.ct_eq(&T::identity()) == 1u8
}
}

View file

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