removed useless assignments at some places
Merge pull request #2671 from akshaymohite/optimization-fixes

removed useless assignments at some places