Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit c9b0af7

Browse files
committed
cleanup
1 parent 0310489 commit c9b0af7

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

src/math/log.rs

+5-22
Original file line numberDiff line numberDiff line change
@@ -426,30 +426,13 @@ impl DInt64 {
426426
}
427427

428428
fn cmp(&self, other: &Self) -> Ordering {
429-
let cmp = |a, b| (a > b) as i32 - (a < b) as i32;
430-
let cmpu = |a, b| (a > b) as i32 - (a < b) as i32;
431-
let r = if cmp(self.ex, other.ex) != 0 {
432-
cmp(self.ex, other.ex)
433-
} else if cmpu(self.hi, other.hi) != 0 {
434-
cmpu(self.hi, other.hi)
429+
if self.ex != other.ex {
430+
self.ex.cmp(&other.ex)
431+
} else if self.hi != other.hi {
432+
self.hi.cmp(&other.hi)
435433
} else {
436-
cmpu(self.lo, other.lo)
437-
};
438-
if r == -1 {
439-
Ordering::Less
440-
} else if r == 0 {
441-
Ordering::Equal
442-
} else {
443-
Ordering::Greater
434+
self.lo.cmp(&other.lo)
444435
}
445-
446-
// if self.ex != other.ex {
447-
// self.ex.cmp(&other.ex)
448-
// } else if self.hi != other.hi {
449-
// self.hi.cmp(&other.hi)
450-
// } else {
451-
// self.lo.cmp(&other.lo)
452-
// }
453436
}
454437

455438
fn pow2(&self) -> Self {

0 commit comments

Comments
 (0)