Skip to content

Commit

Permalink
Remove dead code in getindex(::AbstractModel, ::Symbol) (#3868)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Nov 5, 2024
1 parent 66c02b4 commit b68df42
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/JuMP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1068,15 +1068,6 @@ function Base.getindex(m::AbstractModel, name::Symbol)
obj_dict = object_dictionary(m)
if !haskey(obj_dict, name)
throw(KeyError(name))
elseif obj_dict[name] === nothing
error(
"There are multiple variables and/or constraints named $name " *
"that are already attached to this model. If creating variables " *
"programmatically, use the anonymous variable syntax " *
"`x = @variable(m, [1:N], ...)`. If creating constraints " *
"programmatically, use the anonymous constraint syntax " *
"`con = @constraint(m, ...)`.",
)
end
return obj_dict[name]
end
Expand Down

0 comments on commit b68df42

Please sign in to comment.