diff --git a/src/Bridges/bridge_optimizer.jl b/src/Bridges/bridge_optimizer.jl index c8ed694690..8857c2c809 100644 --- a/src/Bridges/bridge_optimizer.jl +++ b/src/Bridges/bridge_optimizer.jl @@ -1514,7 +1514,7 @@ function MOI.get( vi::MOI.VariableIndex, ) if is_bridged(b, vi) - return get(b.var_to_name, vi, MOI.Utilities.EMPTYSTRING) + return get(b.var_to_name, vi, "") else return MOI.get(b.model, attr, vi) end @@ -1541,7 +1541,7 @@ function MOI.get( constraint_index::MOI.ConstraintIndex, ) if is_bridged(b, constraint_index) - return get(b.con_to_name, constraint_index, MOI.Utilities.EMPTYSTRING) + return get(b.con_to_name, constraint_index, "") else return MOI.get(b.model, attr, constraint_index) end diff --git a/src/Utilities/model.jl b/src/Utilities/model.jl index 660781b8df..04b435764c 100644 --- a/src/Utilities/model.jl +++ b/src/Utilities/model.jl @@ -4,8 +4,6 @@ # Use of this source code is governed by an MIT-style license that can be found # in the LICENSE.md file or at https://opensource.org/licenses/MIT. -const EMPTYSTRING = "" - # Implementation of MOI for AbstractModel abstract type AbstractModelLike{T} <: MOI.ModelLike end abstract type AbstractOptimizer{T} <: MOI.AbstractOptimizer end @@ -166,7 +164,7 @@ function MOI.get( ::MOI.VariableName, vi::MOI.VariableIndex, ) - return get(model.var_to_name, vi, EMPTYSTRING) + return get(model.var_to_name, vi, "") end """ @@ -261,7 +259,7 @@ function MOI.get( ::MOI.ConstraintName, ci::MOI.ConstraintIndex, ) - return get(model.con_to_name, ci, EMPTYSTRING) + return get(model.con_to_name, ci, "") end """ @@ -767,7 +765,7 @@ for (loop_name, loop_super_type) in [ ext::Dict{Symbol,Any} function $name{T,O,V,C}() where {T,O,V,C} return new{T,O,V,C}( - EMPTYSTRING, + "", O(), V(), C(), diff --git a/src/Utilities/universalfallback.jl b/src/Utilities/universalfallback.jl index 63f001143a..0e5a82d2c2 100644 --- a/src/Utilities/universalfallback.jl +++ b/src/Utilities/universalfallback.jl @@ -626,7 +626,7 @@ function MOI.get( if MOI.supports_constraint(uf.model, F, S) return MOI.get(uf.model, attr, ci) end - return get(uf.con_to_name, ci, EMPTYSTRING) + return get(uf.con_to_name, ci, "") end function MOI.get(uf::UniversalFallback, ::Type{MOI.VariableIndex}, name::String)