removed useless `if` statements. Thanks @wgx731