+1 for moving this if statement inside the loop. The single bool test should not impact performance...