Skip to content

Commit 9e9931e

Browse files
authored
Merge pull request #16 from ShenMian/fix/clippy
refactor(lib): replace manual clamp with f32::clamp
2 parents 0941abe + f648a04 commit 9e9931e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/lib.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -698,13 +698,7 @@ impl Constants {
698698
}
699699

700700
// (E + ω)ᵢ₊₁ = (E + ω)ᵢ + Δ(E + ω)ᵢ|[-0.95, 0.95]
701-
ew += if delta < -0.95 {
702-
-0.95
703-
} else if delta > 0.95 {
704-
0.95
705-
} else {
706-
delta
707-
};
701+
ew += delta.clamp(-0.95, 0.95);
708702
}
709703

710704
// p₃₉ = aₓₙ² + aᵧₙ²

0 commit comments

Comments
 (0)