Skip to content

Commit 70c7a1b

Browse files
authored
[Utilities] remove special iterators from CleverDict (#2051)
1 parent 75ab4b4 commit 70c7a1b

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

src/Utilities/CleverDicts.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,6 @@ function Base.haskey(c::CleverDict{K}, key::K) where {K}
148148
return haskey(c.dict, key)
149149
end
150150

151-
function Base.keys(c::CleverDict{K}) where {K}
152-
if _is_dense(c)
153-
return K[_inverse_hash(c, i) for i in 1:length(c.vector)]
154-
end
155-
return collect(keys(c.dict))
156-
end
157-
158151
function Base.get(c::CleverDict, key, default)
159152
if _is_dense(c)
160153
if !haskey(c, key)
@@ -316,8 +309,6 @@ function Base.resize!(c::CleverDict{K,V}, n) where {K,V}
316309
return
317310
end
318311

319-
Base.values(d::CleverDict) = _is_dense(d) ? d.vector : values(d.dict)
320-
321312
# TODO `map!(f, values(dict::AbstractDict))` requires Julia 1.2 or later,
322313
# use `map_values` once we drop Julia 1.1 and earlier.
323314
function map_values!(f::Function, d::CleverDict)

src/Utilities/vector_of_constraints.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function MOI.get(
154154
v::VectorOfConstraints{F,S},
155155
::MOI.ListOfConstraintIndices{F,S},
156156
) where {F,S}
157-
return keys(v.constraints)
157+
return collect(keys(v.constraints))
158158
end
159159

160160
function MOI.modify(

0 commit comments

Comments
 (0)