C++: Remove a redundant variable.