Skip to content

Commit

Permalink
small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
dheijl committed Aug 29, 2024
1 parent 6f28f32 commit 0c19666
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/utils/rwstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ impl ChannelStream {
}
let i24sample = i32::from_sample(self.fifo.pop_front().unwrap()) >> 8;
let b = i24sample.to_le_bytes();
let mut s = [0u8; 3];
s.copy_from_slice(&b[0..3]);
s
[b[0], b[1], b[2]]
}

// get the next be24sample
Expand All @@ -165,9 +163,7 @@ impl ChannelStream {
}
let i24sample = i32::from_sample(self.fifo.pop_front().unwrap()) >> 8;
let b = i24sample.to_be_bytes();
let mut s = [0u8; 3];
s.copy_from_slice(&b[1..4]);
s
[b[1], b[2], b[3]]
}
}

Expand Down

0 comments on commit 0c19666

Please sign in to comment.