diff --git a/libs/temporal/tempo.cc b/libs/temporal/tempo.cc index f070f46658..f75e4c6cb8 100644 --- a/libs/temporal/tempo.cc +++ b/libs/temporal/tempo.cc @@ -360,8 +360,6 @@ Meter::bbt_delta (BBT_Time const & later, BBT_Time const & earlier) const assert (later > earlier); -#if 1 // more efficient than iterative method below - BBT_Offset d; BBT_Time a (earlier); BBT_Time b (later); @@ -388,54 +386,6 @@ Meter::bbt_delta (BBT_Time const & later, BBT_Time const & earlier) const d.bars = b.bars - a.bars; return d; - -#else - BBT_Time a (earlier); - BBT_Time b (later); - int32_t d_bars = 0; - int32_t d_beats = 0; - int32_t d_ticks = 0; - - /* Walk to next grid-beat, counting ticks (and wrapped beats and bars - * if necessary) - */ - - while (a.ticks < b.ticks) { - if (a.ticks == ticks_per_grid()) { - a.ticks = 0; /* not necessary but here for consistency */ - a.beats++; - d_beats++; - if (a.beats == _divisions_per_bar) { - a.beats = 1; - a.bars++; - d_bars++; - } - break; - } - a.ticks++; - d_ticks++; - } - - /* Walk to next bar, counting beats (and bars - * if necessary) - */ - while (a.beats < b.beats) { - if (a.beats == _divisions_per_bar) { - a.beats = 1; - a.bars++; - d_bars++; - break; - } - a.beats++; - d_beats++; - } - - /* count bars */ - - d_bars = b.bars - a.bars; - - return BBT_Offset (d_bars, d_beats, d_ticks); -#endif } Temporal::Beats