mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-04 20:24:10 +00:00
Remove unnecessary if statements
This commit is contained in:
parent
e74bf8e789
commit
b3041f2adc
2 changed files with 2 additions and 14 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue