Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/broadcasting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ end
# of respecting Union eltypes than the default method in Base.
function Base.Broadcast.broadcasted(f, x::ComponentArray)
data = getdata(x)
new_data = similar(data)
@inbounds for i in eachindex(data)
new_data[i] = f(data[i])
end
new_data = map(f, x)
return ComponentArray(new_data, getaxes(x))
end

Expand Down Expand Up @@ -116,4 +113,4 @@ function fill_flat(Ax::VarAxes, N)
axs = (axs..., ntuple(x -> FlatAxis(), N-n)...)
end
return axs
end
end