diff --git a/src/MOI_wrapper.jl b/src/MOI_wrapper.jl index b3626255d..31c0f7368 100644 --- a/src/MOI_wrapper.jl +++ b/src/MOI_wrapper.jl @@ -142,23 +142,7 @@ function starting_value(optimizer::Optimizer{T}, i) where {T} return optimizer.starting_values[i] else v = optimizer.variables - has_lower_bound = !iszero(v.set_mask[i] & MOI.Utilities._LOWER_BOUND_MASK) - has_upper_bound = !iszero(v.set_mask[i] & MOI.Utilities._UPPER_BOUND_MASK) - if has_lower_bound && has_upper_bound - if zero(T) <= v.lower[i] - return v.lower[i] - elseif v.upper[i] <= zero(T) - return v.upper[i] - else - return zero(T) - end - elseif has_lower_bound - return max(zero(T), v.lower[i]) - elseif has_upper_bound - return min(zero(T), v.upper[i]) - else - return zero(T) - end + return min(max(zero(T), v.lower[i]), v.upper[i]) end end