From 9bec02330ee42c8ce974a9864351c97c57ecc374 Mon Sep 17 00:00:00 2001 From: Justin Willmert Date: Fri, 4 Jan 2019 18:24:16 -0600 Subject: [PATCH] Simply call _copy instead of passing through the broadcast machinery again --- stdlib/SparseArrays/src/higherorderfns.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/SparseArrays/src/higherorderfns.jl b/stdlib/SparseArrays/src/higherorderfns.jl index 05f14c647e5e2..66ab8b3f60e52 100644 --- a/stdlib/SparseArrays/src/higherorderfns.jl +++ b/stdlib/SparseArrays/src/higherorderfns.jl @@ -1128,7 +1128,7 @@ function copy(bc::Broadcasted{PromoteToSparse}) if can_skip_sparsification(bcf.f, bcf.args...) return _copy(bcf.f, bcf.args...) elseif is_supported_sparse_broadcast(bcf.args...) - return broadcast(bcf.f, map(_sparsifystructured, bcf.args)...) + return _copy(bcf.f, map(_sparsifystructured, bcf.args)...) else return copy(convert(Broadcasted{Broadcast.DefaultArrayStyle{length(axes(bc))}}, bc)) end