From 165765145c07c5f25bf52e89e7c319b9cb125f8f Mon Sep 17 00:00:00 2001 From: William McPherson Date: Mon, 23 Dec 2019 19:14:07 +1100 Subject: [PATCH] Piano: Remove redundant logic in fill_audio_buffer "If 0, set to val" is the same as "add val". --- Applications/Piano/PianoWidget.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Applications/Piano/PianoWidget.cpp b/Applications/Piano/PianoWidget.cpp index cad78195cf..f064dc3fd0 100644 --- a/Applications/Piano/PianoWidget.cpp +++ b/Applications/Piano/PianoWidget.cpp @@ -78,10 +78,7 @@ void PianoWidget::fill_audio_buffer(uint8_t* stream, int len) val = ((volume * m_power[n]) * w_triangle(n)); else if (m_wave_type == WaveType::Noise) val = ((volume * m_power[n]) * w_noise()); - if (sst[i].left == 0) - sst[i].left = val; - else - sst[i].left += val; + sst[i].left += val; } sst[i].right = sst[i].left; }