Removed unnecessary assignment inside a loop