aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-03-03 10:31:27 -0800
committerChris Robinson <[email protected]>2012-03-03 10:31:27 -0800
commit487d05a73e93c2a5951c7ebf8e2fd33ff5a95332 (patch)
treefe20bee3e2b53aab040551601c7cc7d6e368fc6a /Alc/ALu.c
parent91ed077ebadf125913f3572ac216f6c7262b2553 (diff)
Invert a nested loop
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c9
1 files 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]); \
} \
}