Remove duplicated "if".