remove if else for same return
Merge pull request #4243 from samsonasik/fix/ifelse.remv

remove if else for same return
Merge branch 'hotfix/4243'

Close #4243