Remove redundant conditional

`else` branch matches the `else if`, so only one is required
Remove unused variable
Merge pull request #225 from nschonni/cppchecking

Cppchecking