Skip to content

Commit d418555

Browse files
authored
[breaking] remove unused Containers.generate_container (#2744)
1 parent 7d58b7f commit d418555

File tree

4 files changed

+19
-369
lines changed

4 files changed

+19
-369
lines changed

src/Containers/Containers.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ function Base.collect_to_with_first!(
4949
return dest
5050
end
5151

52-
include("generate_container.jl")
5352
include("vectorized_product_iterator.jl")
5453
include("nested_iterator.jl")
5554
include("no_duplicate_dict.jl")

src/Containers/generate_container.jl

Lines changed: 0 additions & 169 deletions
This file was deleted.

src/Containers/macro.jl

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,24 @@ function _parse_ref_sets(_error::Function, expr::Expr)
143143
end
144144
_parse_ref_sets(_error::Function, expr) = (Any[], Any[], :())
145145

146+
_depends_on(ex::Expr, s::Symbol) = any(a -> _depends_on(a, s), ex.args)
147+
148+
_depends_on(ex::Symbol, s::Symbol) = ex == s
149+
150+
_depends_on(ex, s::Symbol) = false
151+
152+
function _has_dependent_sets(idxvars, idxsets)
153+
# check if any index set depends on a previous index var
154+
for i in 2:length(idxsets)
155+
for j in 1:(i-1)
156+
if _depends_on(idxsets[i], idxvars[j])
157+
return true
158+
end
159+
end
160+
end
161+
return false
162+
end
163+
146164
"""
147165
_build_ref_sets(_error::Function, expr)
148166
@@ -161,7 +179,7 @@ function _build_ref_sets(_error::Function, expr)
161179
"cannot use splatting operator `...` in the definition of an index set.",
162180
)
163181
end
164-
has_dependent = has_dependent_sets(idxvars, idxsets)
182+
has_dependent = _has_dependent_sets(idxvars, idxsets)
165183
if has_dependent || condition != :()
166184
esc_idxvars = esc.(idxvars)
167185
idxfuns = [

0 commit comments

Comments
 (0)