From 487d05a73e93c2a5951c7ebf8e2fd33ff5a95332 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 3 Mar 2012 10:31:27 -0800 Subject: Invert a nested loop --- Alc/ALu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Alc/ALu.c b/Alc/ALu.c index 398912da..be1f6103 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -813,10 +813,13 @@ static void Write_##T##_##N(ALCdevice *device, T *RESTRICT buffer, \ const enum Channel *ChanMap = device->DevChannels; \ ALuint i, j; \ \ - for(i = 0;i < SamplesToDo;i++) \ + for(j = 0;j < N;j++) \ { \ - for(j = 0;j < N;j++) \ - *(buffer++) = func(DryBuffer[i][ChanMap[j]]); \ + T *RESTRICT out = buffer + j; \ + enum Channel chan = ChanMap[j]; \ + \ + for(i = 0;i < SamplesToDo;i++) \ + out[i*N] = func(DryBuffer[i][chan]); \ } \ } -- cgit v1.2.3