Skip to content

Commit

Permalink
Remove dead code in getindex(::AbstractModel, ::Symbol)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Nov 5, 2024
1 parent 139bead commit 28a8f1f
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 28a8f1f

Please sign in to comment.