Skip to content

Bridges should return get by value, not reference #1346

@odow

Description

@odow

Check all get return values not references that the user can modify without fear.

As one example:

MOI.get(b::GeoMeanBridge, ::MOI.ListOfVariableIndices) = b.xij

If the user were to modify the returned value, this would modify the vector inside the bridge.

The fix would be

MOI.get(b::GeoMeanBridge, ::MOI.ListOfVariableIndices) = copy(b.xij)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions