Optimized ConstraintCheck.