summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorWilliam McPherson <willmcpherson2@gmail.com>2019-12-23 19:14:07 +1100
committerAndreas Kling <awesomekling@gmail.com>2019-12-23 15:08:15 +0100
commit165765145c07c5f25bf52e89e7c319b9cb125f8f (patch)
tree3648956b656b22cf331d6434d070486710cb6665 /Applications
parentc96c33624d68b73b953fe131ff1af29100043571 (diff)
downloadserenity-165765145c07c5f25bf52e89e7c319b9cb125f8f.zip
Piano: Remove redundant logic in fill_audio_buffer
"If 0, set to val" is the same as "add val".
Diffstat (limited to 'Applications')
-rw-r--r--Applications/Piano/PianoWidget.cpp5
1 files changed, 1 insertions, 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;
}