Skip to content

Commit

Permalink
Fix #22255 by inlining the necessary methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mbauman committed Apr 23, 2018
1 parent df51b31 commit a1d4e7e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions base/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ broadcast_similar(::ArrayConflict, ::Type{Bool}, inds::Indices, bc) =
broadcast_axes() = ()
broadcast_axes(A::Tuple) = (OneTo(length(A)),)
broadcast_axes(A::Ref) = ()
broadcast_axes(A) = axes(A)
@inline broadcast_axes(A) = axes(A)
"""
Base.broadcast_axes(A)
Expand All @@ -218,9 +218,9 @@ broadcast_axes

### End of methods that users will typically have to specialize ###

Base.axes(bc::Broadcasted) = _axes(bc, bc.axes)
@inline Base.axes(bc::Broadcasted) = _axes(bc, bc.axes)
_axes(::Broadcasted, axes::Tuple) = axes
_axes(bc::Broadcasted, ::Nothing) = combine_axes(bc.args...)
@inline _axes(bc::Broadcasted, ::Nothing) = combine_axes(bc.args...)
_axes(bc::Broadcasted{Style{Tuple}}, ::Nothing) = (Base.OneTo(length(longest_tuple(nothing, bc.args))),)
_axes(bc::Broadcasted{<:AbstractArrayStyle{0}}, ::Nothing) = ()

Expand Down Expand Up @@ -412,7 +412,7 @@ One of these should be undefined (and thus return Broadcast.Unknown).""")
end

# Indices utilities
combine_axes(A, B...) = broadcast_shape(broadcast_axes(A), combine_axes(B...))
@inline combine_axes(A, B...) = broadcast_shape(broadcast_axes(A), combine_axes(B...))
combine_axes(A) = broadcast_axes(A)

# shape (i.e., tuple-of-indices) inputs
Expand Down

0 comments on commit a1d4e7e

Please sign in to comment.