From c13569af9230e6e7c8a44602eaa3a6b6a28aaef8 Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Thu, 28 Jan 2021 20:26:50 +0100 Subject: [PATCH] use @BioTurboNick's cool splatting trick --- base/abstractarray.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 17fb978680bf2..59e589bcd55a6 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -1793,10 +1793,9 @@ typed_hcat(T::Type, A::AbstractArray...) = cat_t(T, A...; dims=Val(2)) # 2d horizontal and vertical concatenation -tuple_cat(t) = foldl((x, y) -> (x..., y...), t; init=()) # these are produced in lowering if splatting occurs inside hvcat -hvcat_rows(rows::Tuple...) = hvcat(map(length, rows), tuple_cat(rows)...) -typed_hvcat_rows(T::Type, rows::Tuple...) = typed_hvcat(T, map(length, rows), tuple_cat(rows)...) +hvcat_rows(rows::Tuple...) = hvcat(map(length, rows), (rows...)...) +typed_hvcat_rows(T::Type, rows::Tuple...) = typed_hvcat(T, map(length, rows), (rows...)...) function hvcat(nbc::Integer, as...) # nbc = # of block columns