remove redundant comparison