Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Nov 15, 2023
1 parent 73160be commit 34d2d23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ end

function MOI.get(model::Optimizer, ::MOI.NumberOfConstraints{F,S}) where {F,S}
f = Base.Fix2(isa, MOI.ConstraintIndex{F,S})

Check warning on line 435 in src/MOI_wrapper.jl

View check run for this annotation

Codecov / codecov/patch

src/MOI_wrapper.jl#L435

Added line #L435 was not covered by tests
return count(f, keys(model.constraint_mapping); init = 0)
return count(f, keys(model.constraint_mapping); init=0)
end

###
Expand Down Expand Up @@ -1002,7 +1002,7 @@ end
function MOI.add_constraint(model::Optimizer, f::MOI.ScalarNonlinearFunction, s::_SETS)
index = MOI.Nonlinear.add_constraint(model.nlp_model, f, s)
ci = MOI.ConstraintIndex{typeof(f),typeof(s)}(index.value)
model.constraint_mapping[ci] = index.value
model.constraint_mapping[ci] = convert(Cint, index.value)
return ci
end

Expand Down

0 comments on commit 34d2d23

Please sign in to comment.