Skip to content

Commit

Permalink
Merge branch 'master' into od/acronyms
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Sep 21, 2023
2 parents 3fa1e3b + 3681c6e commit 74187f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Bridges/bridge_optimizer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 3 additions & 5 deletions src/Utilities/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

"""
Expand Down Expand Up @@ -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

"""
Expand Down Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/universalfallback.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 74187f0

Please sign in to comment.