Fix Issue 12608 - Avoid dead assignments.
Merge pull request #2096 from AndrejMitrovic/Fix12608

[Trivial] Issue 12608 - Avoid dead assignments.