AUDIO: Simplify iterating backwards over an array.

This commit is contained in:
Christoph Mallon 2011-08-07 12:07:54 +02:00
parent 3ee307e6b3
commit d1688d22d4

View file

@ -707,8 +707,8 @@ int8 MaxTrax::noteOn(ChannelContext &channel, const byte note, uint16 volume, ui
if ((channel.flags & ChannelContext::kFlagMono) == 0) {
voiceNum = pickvoice((channel.flags & ChannelContext::kFlagRightChannel) != 0 ? 1 : 0, pri);
} else {
VoiceContext *voice = ARRAYEND(_voiceCtx) - 1;
for (voiceNum = ARRAYSIZE(_voiceCtx) - 1; voiceNum >= 0 && voice->channel != &channel; --voiceNum, --voice)
VoiceContext *voice = ARRAYEND(_voiceCtx);
for (voiceNum = ARRAYSIZE(_voiceCtx); voiceNum-- != 0 && --voice->channel != &channel;)
;
if (voiceNum < 0)
voiceNum = pickvoice((channel.flags & ChannelContext::kFlagRightChannel) != 0 ? 1 : 0, pri);