Skip to content

Commit ceb4022

Browse files
authored
Merge pull request #316 from JuliaOpt/bl/findfirst
Update findfirst for Julia v0.7
2 parents c1ab163 + 91b6597 commit ceb4022

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Utilities/functions.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ end
358358
function _modifycoefficient(variables::Vector{MOI.VariableIndex}, coefficients::Vector, variable::MOI.VariableIndex, new_coefficient)
359359
variables = copy(variables)
360360
coefficients = copy(coefficients)
361-
i = findfirst(variables, variable)
362-
if (VERSION >= v"0.7.0-DEV.3395" && i === nothing) || (VERSION < v"0.7.0-DEV.3395" && iszero(i))
361+
i = coalesce(findfirst(isequal(variable), variables), 0)
362+
if iszero(i)
363363
# The variable was not already in the function
364364
if !iszero(new_coefficient)
365365
push!(variables, variable)

0 commit comments

Comments
 (0)