Rollup merge of #77921 - wcampbell0x2a:f64-collapsible-if, r=jyn514
f64: Refactor collapsible_if
This commit is contained in:
commit
02a4b58a3f
1 changed files with 12 additions and 14 deletions
|
@ -920,8 +920,7 @@ impl f64 {
|
||||||
fn log_wrapper<F: Fn(f64) -> f64>(self, log_fn: F) -> f64 {
|
fn log_wrapper<F: Fn(f64) -> f64>(self, log_fn: F) -> f64 {
|
||||||
if !cfg!(any(target_os = "solaris", target_os = "illumos")) {
|
if !cfg!(any(target_os = "solaris", target_os = "illumos")) {
|
||||||
log_fn(self)
|
log_fn(self)
|
||||||
} else {
|
} else if self.is_finite() {
|
||||||
if self.is_finite() {
|
|
||||||
if self > 0.0 {
|
if self > 0.0 {
|
||||||
log_fn(self)
|
log_fn(self)
|
||||||
} else if self == 0.0 {
|
} else if self == 0.0 {
|
||||||
|
@ -938,4 +937,3 @@ impl f64 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue