[core] In spheroid, replace if with ?: operator.