File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name = " MeasureBase"
22uuid = " fa1605e6-acd5-459c-a1e6-7e635759db14"
33authors = [" Chad Scherrer <chad.scherrer@gmail.com> and contributors" ]
4- version = " 0.6.1 "
4+ version = " 0.6.2 "
55
66[deps ]
77Compat = " 34da2185-b29b-5c13-b0c7-acf172513d20"
Original file line number Diff line number Diff line change 7373
7474export basemeasure_sequence
7575
76- @inline function basemeasure_sequence (μ:: M ) where {M}
77- depth = basemeasure_depth (μ)
78- basemeasure_sequence (μ, depth)
79- end
80-
81- @generated function basemeasure_sequence (μ:: M , :: StaticInt{N} ) where {M,N}
82- quote
83- b_1 = μ
84- Base. Cartesian. @nexprs 10 i -> begin # 10 is just some "big enough" number
85- b_{i+ 1 } = basemeasure (b_{i})
76+ @inline function basemeasure_sequence (μ:: M ) where {M}
77+ b_1 = μ
78+ done = false
79+ Base. Cartesian. @nexprs 10 i -> begin # 10 is just some "big enough" number
80+ b_{i+ 1 } = if done nothing else basemeasure (b_{i}) end
81+ if b_{i+ 1 } isa typeof (b_{i})
82+ done = true
83+ b_{i+ 1 } = nothing
8684 end
87- return Base. Cartesian. @ntuple $ (N+ 1 ) b
8885 end
86+ return filter (! isnothing, Base. Cartesian. @ntuple 10 b)
8987end
9088
9189# @inline function basemeasure_depth(μ::M) where {M}
You can’t perform that action at this time.
0 commit comments