The variable will only be defined once if declared outside the loop. Seems like a micro-optimization and if you think inside the loop is more readable/maintainable I'll move it inside.