Skip to content

Commit e9b3ab2

Browse files
authored
Fix map_indices with attributes (#2367)
1 parent c6d91a4 commit e9b3ab2

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/Bridges/bridge.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ MOI.is_set_by_optimize(::FirstBridge) = true
340340
MOI.get(::MOI.ModelLike, ::FirstBridge, b::MOI.Bridges.AbstractBridge) = b
341341

342342
function MOI.Utilities.map_indices(
343-
::Function,
343+
::Any,
344344
::FirstBridge,
345345
b::MOI.Bridges.AbstractBridge,
346346
)

src/Utilities/functions.jl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,10 @@ constraint functions, attribute values and submittable values. If you define a
221221
new attribute whose values `x::X` contain variable or constraint indices, you
222222
must also implement this function.
223223
"""
224-
map_indices(f::Function, ::MOI.AnyAttribute, x) = map_indices(f, x)
225-
226-
function map_indices(
227-
variable_map::AbstractDict{T,T},
228-
attr::MOI.AnyAttribute,
229-
x::X,
230-
)::X where {T<:MOI.Index,X}
231-
return map_indices(Base.Fix1(getindex, variable_map), attr, x)
232-
end
224+
map_indices(f, ::MOI.AnyAttribute, x) = map_indices(f, x)
233225

234226
# RawOptimizerAttribute values are passed through un-changed.
235-
map_indices(::Function, ::MOI.RawOptimizerAttribute, x) = x
227+
map_indices(::Any, ::MOI.RawOptimizerAttribute, x) = x
236228

237229
"""
238230
map_indices(

0 commit comments

Comments
 (0)