Skip to content

Commit

Permalink
Avoid 1.0 float comparison.
Browse files Browse the repository at this point in the history
  • Loading branch information
anarkiwi committed Jan 5, 2020
1 parent 19e35b4 commit 14c952b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Oscillator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ void Oscillator::SetFreqLazy(cr_fp_t newHz, cr_fp_t maxHz, cr_fp_t newVelocitySc

void Oscillator::SetFreq(cr_fp_t newHz, cr_fp_t maxHz, cr_fp_t newVelocityScale, cr_tick_t masterClock, int newPeriodOffset) {
SetFreqLazy(newHz, maxHz, newVelocityScale, newPeriodOffset);
if (hz == 1.0) {
ScheduleNow(masterClock);
} else {
if (hz > 1.0) {
ScheduleNext(masterClock);
} else {
ScheduleNow(masterClock);
}
}

0 comments on commit 14c952b

Please sign in to comment.