← Back to context Comment by gpderetta 1 hour ago https://en.wikipedia.org/wiki/Loop_unswitching 1 comment gpderetta Reply econ 30 minutes ago bool w; int x[1000]; int y[1000]; for(int i=0;i<1000;i++){ x[i] += y[i]; } if(w){ for(int i=0;i<1000;i++){ y[i] = 0; } } Slower but prettier with the if pushed down.
econ 30 minutes ago bool w; int x[1000]; int y[1000]; for(int i=0;i<1000;i++){ x[i] += y[i]; } if(w){ for(int i=0;i<1000;i++){ y[i] = 0; } } Slower but prettier with the if pushed down.
Slower but prettier with the if pushed down.