Skip to content

Commit

Permalink
perf: use else if
Browse files Browse the repository at this point in the history
Probably the smallest performance improvement I could make. Likely was
optimized by the compiler anyways: however, it's best to follow good
practice.
  • Loading branch information
DakshG07 committed Aug 22, 2024
1 parent a45f718 commit 9444636
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ impl ComplexAngle {
// If angle is greater than 180, subtract 360
if angle > 180 {
return angle - 360;
}
if angle < -180 {
} else if angle < -180 {
return angle + 360;
}
// Otherwise, we're fine
Expand Down

0 comments on commit 9444636

Please sign in to comment.