core: reduce redundant condition check.