Skip to content

Commit

Permalink
removed useless function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
fruit-bird committed Feb 15, 2024
1 parent 16293b9 commit 5ee3709
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion components/src/delay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ impl DelayComponent {
impl AudioProcessor for DelayComponent {
fn process_audio(&mut self, audio_buffer: AudioIterator) -> AudioBuffer {
let output = audio_buffer
.into_iter()
.enumerate()
.map(|(i, sample)| {
let delayed_sample = self.buffer.get(i).unwrap_or(&0.0);
Expand Down
6 changes: 1 addition & 5 deletions components/src/gain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ impl GainComponent {

impl AudioProcessor for GainComponent {
fn process_audio(&mut self, audio_buffer: AudioIterator) -> AudioBuffer {
let output = audio_buffer
.into_iter()
.map(|sample| sample * self.gain)
.collect();

let output = audio_buffer.map(|sample| sample * self.gain).collect();
Audio![output as Stereo]
}
}

0 comments on commit 5ee3709

Please sign in to comment.