@@ -295,7 +295,7 @@ some cases.
295
295
function flatten (bc:: Broadcasted{Style} ) where {Style}
296
296
isflat (bc) && return bc
297
297
# concatenate the nested arguments into {a, b, c, d}
298
- args = cat_nested (x -> x . args, bc)
298
+ args = cat_nested (bc)
299
299
# build a function `makeargs` that takes a "flat" argument list and
300
300
# and creates the appropriate input arguments for `f`, e.g.,
301
301
# makeargs = (w, x, y, z) -> (w, g(x, y), z)
@@ -318,14 +318,9 @@ _isflat(args::NestedTuple) = false
318
318
_isflat (args:: Tuple ) = _isflat (tail (args))
319
319
_isflat (args:: Tuple{} ) = true
320
320
321
- cat_nested (fieldextractor, bc:: Broadcasted ) = cat_nested (fieldextractor, fieldextractor (bc), ())
322
-
323
- cat_nested (fieldextractor, t:: Tuple , rest) =
324
- (t[1 ], cat_nested (fieldextractor, tail (t), rest)... )
325
- cat_nested (fieldextractor, t:: Tuple{<:Broadcasted,Vararg{Any}} , rest) =
326
- cat_nested (fieldextractor, cat_nested (fieldextractor, fieldextractor (t[1 ]), tail (t)), rest)
327
- cat_nested (fieldextractor, t:: Tuple{} , tail) = cat_nested (fieldextractor, tail, ())
328
- cat_nested (fieldextractor, t:: Tuple{} , tail:: Tuple{} ) = ()
321
+ cat_nested (t:: Broadcasted , rest... ) = (cat_nested (t. args... )... , cat_nested (rest... )... )
322
+ cat_nested (t:: Any , rest... ) = (t, cat_nested (rest... )... )
323
+ cat_nested () = ()
329
324
330
325
make_makeargs (bc:: Broadcasted ) = make_makeargs (()-> (), bc. args)
331
326
@inline function make_makeargs (makeargs, t:: Tuple )
0 commit comments