mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-09 08:31:33 +11:00
Extract even more from the loop body
This commit is contained in:
parent
57f0a8c889
commit
38868cb269
|
@ -422,7 +422,10 @@ impl MixerBuffer {
|
||||||
) {
|
) {
|
||||||
working_buffer.fill(0.into());
|
working_buffer.fill(0.into());
|
||||||
|
|
||||||
for channel in channels.filter(|channel| !channel.is_done) {
|
for (channel, playback_speed) in
|
||||||
|
channels
|
||||||
|
.filter(|channel| !channel.is_done)
|
||||||
|
.filter_map(|channel| {
|
||||||
let playback_speed = if channel.is_stereo {
|
let playback_speed = if channel.is_stereo {
|
||||||
2.into()
|
2.into()
|
||||||
} else {
|
} else {
|
||||||
|
@ -437,10 +440,13 @@ impl MixerBuffer {
|
||||||
channel.pos = 0.into();
|
channel.pos = 0.into();
|
||||||
} else {
|
} else {
|
||||||
channel.is_done = true;
|
channel.is_done = true;
|
||||||
continue;
|
return None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some((channel, playback_speed))
|
||||||
|
})
|
||||||
|
{
|
||||||
if channel.volume != 0.into() {
|
if channel.volume != 0.into() {
|
||||||
if channel.is_stereo {
|
if channel.is_stereo {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
Loading…
Reference in a new issue