diff options
author | Chris Robinson <[email protected]> | 2012-03-03 10:31:27 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-03-03 10:31:27 -0800 |
commit | 487d05a73e93c2a5951c7ebf8e2fd33ff5a95332 (patch) | |
tree | fe20bee3e2b53aab040551601c7cc7d6e368fc6a | |
parent | 91ed077ebadf125913f3572ac216f6c7262b2553 (diff) |
Invert a nested loop
-rw-r--r-- | Alc/ALu.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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]); \ } \ } |