Remove useless else...return
Simplify extractOptionalParameters
Merge pull request #5779 from lucasmichot/4.2-useless-else

[4.2] Remove useless else...return