Optimize a condition