Can I use Duff's Device on an array in C?

Posted by Ben Fossen on Stack Overflow See other posts from Stack Overflow or by Ben Fossen
Published on 2010-04-30T21:28:13Z Indexed on 2010/04/30 21:37 UTC
Read the original article Hit count: 277

Filed under:
|
|

I have a loop here and I want to make it run faster. I am passing in a large array. I recently heard of Duff's Device can it be applied to this for loop? any ideas?

for (i = 0; i < dim; i++) {
    for (j = 0; j < dim; j++) {
        dst[RIDX(dim-1-j, i, dim)] = src[RIDX(i, j, dim)];
    }
}

© Stack Overflow or respective owner

Related posts about c

    Related posts about duffs