@@ -133,10 +133,10 @@ end
133133 return DefaultSubstituter {Fold} (d, filter, infer_vartype (d))
134134end
135135@inline function DefaultSubstituter {Fold} (d:: Pair , filter:: F ) where {Fold, F}
136- DefaultSubstituter {Fold} (Dict (d), filter)
136+ DefaultSubstituter {Fold} (OrderedDict (d), filter)
137137end
138138@inline function DefaultSubstituter {Fold} (d:: AbstractArray{<:Pair} , filter:: F ) where {Fold, F}
139- DefaultSubstituter {Fold} (Dict (d), filter)
139+ DefaultSubstituter {Fold} (OrderedDict (d), filter)
140140end
141141
142142function (s:: Substituter )(ex)
@@ -261,7 +261,7 @@ julia> substitute(1+sqrt(y), Dict(y => 2), fold=Val(false))
261261function substitute (expr, dict; fold:: Val{Fold} = Val {false} (), filterer= default_substitute_filter) where {Fold}
262262 # This is kind of ugly (inlines some of the constructor logic of `DefaultSubstituter` but is needed to avoid runtime subtyping in
263263 # when calling this function. It makes a very big difference in runtime.
264- d = dict isa AbstractDict ? dict : Dict (dict)
264+ d = dict isa AbstractDict ? dict : OrderedDict (dict)
265265 isempty (d) && ! Fold && return expr
266266 VT = infer_vartype (d)
267267 if VT === Nothing
@@ -412,7 +412,7 @@ function search_variables!(buffer, expr::SparseMatrixCSC; kw...)
412412 search_variables! (buffer, V; kw... )
413413end
414414
415- _default_buffer (:: BasicSymbolic{T} ) where {T} = Set {BasicSymbolic{T}} ()
415+ _default_buffer (:: BasicSymbolic{T} ) where {T} = OrderedSet {BasicSymbolic{T}} ()
416416_default_buffer (x:: Any ) = unwrap (x) === x ? Set () : _default_buffer (unwrap (x))
417417
418418function search_variables (expr; kw... )
@@ -423,13 +423,13 @@ end
423423
424424struct ArrayOpReduceCache{T}
425425 new_ranges:: RangesT{T}
426- subrules:: Dict {BasicSymbolic{T}, Int}
427- collapsed_idxs:: Set {BasicSymbolic{T}}
426+ subrules:: OrderedDict {BasicSymbolic{T}, Int}
427+ collapsed_idxs:: OrderedSet {BasicSymbolic{T}}
428428 collapsed_ranges:: Vector{StepRange{Int, Int}}
429429end
430430
431431function ArrayOpReduceCache {T} () where {T}
432- ArrayOpReduceCache {T} (RangesT {T} (), Dict {BasicSymbolic{T}, Int} (), Set {BasicSymbolic{T}} (), StepRange{Int, Int}[])
432+ ArrayOpReduceCache {T} (RangesT {T} (), OrderedDict {BasicSymbolic{T}, Int} (), OrderedSet {BasicSymbolic{T}} (), StepRange{Int, Int}[])
433433end
434434
435435function Base. empty! (x:: ArrayOpReduceCache )
@@ -651,7 +651,7 @@ scalarization_function(::Type{ArrayOp{T}}) where {T} = _scalarize_arrayop
651651function _scalarize_arrayop (_, x:: BasicSymbolic{T} , :: Val{toplevel} ) where {T, toplevel}
652652 @match x begin
653653 BSImpl. ArrayOp (; output_idx, expr, term, ranges, reduce, shape = sh) => begin
654- subrules = Dict ()
654+ subrules = OrderedDict ()
655655 new_expr = reduce_eliminated_idxs (expr, output_idx, ranges, reduce)
656656 empty! (subrules)
657657
0 commit comments