Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/Utilities/CleverDicts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,6 @@ function Base.haskey(c::CleverDict{K}, key::K) where {K}
return haskey(c.dict, key)
end

function Base.keys(c::CleverDict{K}) where {K}
if _is_dense(c)
return K[_inverse_hash(c, i) for i in 1:length(c.vector)]
end
return collect(keys(c.dict))
end

function Base.get(c::CleverDict, key, default)
if _is_dense(c)
if !haskey(c, key)
Expand Down Expand Up @@ -316,8 +309,6 @@ function Base.resize!(c::CleverDict{K,V}, n) where {K,V}
return
end

Base.values(d::CleverDict) = _is_dense(d) ? d.vector : values(d.dict)

# TODO `map!(f, values(dict::AbstractDict))` requires Julia 1.2 or later,
# use `map_values` once we drop Julia 1.1 and earlier.
function map_values!(f::Function, d::CleverDict)
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/vector_of_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function MOI.get(
v::VectorOfConstraints{F,S},
::MOI.ListOfConstraintIndices{F,S},
) where {F,S}
return keys(v.constraints)
return collect(keys(v.constraints))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I guess the issue was that we were returning the concrete list of keys, instead of a lazy evaluator?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly!

end

function MOI.modify(
Expand Down