Skip to content

Commit a1d4e7e

Browse files
committed
Fix #22255 by inlining the necessary methods
1 parent df51b31 commit a1d4e7e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

base/broadcast.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ broadcast_similar(::ArrayConflict, ::Type{Bool}, inds::Indices, bc) =
206206
broadcast_axes() = ()
207207
broadcast_axes(A::Tuple) = (OneTo(length(A)),)
208208
broadcast_axes(A::Ref) = ()
209-
broadcast_axes(A) = axes(A)
209+
@inline broadcast_axes(A) = axes(A)
210210
"""
211211
Base.broadcast_axes(A)
212212
@@ -218,9 +218,9 @@ broadcast_axes
218218

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

221-
Base.axes(bc::Broadcasted) = _axes(bc, bc.axes)
221+
@inline Base.axes(bc::Broadcasted) = _axes(bc, bc.axes)
222222
_axes(::Broadcasted, axes::Tuple) = axes
223-
_axes(bc::Broadcasted, ::Nothing) = combine_axes(bc.args...)
223+
@inline _axes(bc::Broadcasted, ::Nothing) = combine_axes(bc.args...)
224224
_axes(bc::Broadcasted{Style{Tuple}}, ::Nothing) = (Base.OneTo(length(longest_tuple(nothing, bc.args))),)
225225
_axes(bc::Broadcasted{<:AbstractArrayStyle{0}}, ::Nothing) = ()
226226

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

414414
# Indices utilities
415-
combine_axes(A, B...) = broadcast_shape(broadcast_axes(A), combine_axes(B...))
415+
@inline combine_axes(A, B...) = broadcast_shape(broadcast_axes(A), combine_axes(B...))
416416
combine_axes(A) = broadcast_axes(A)
417417

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

0 commit comments

Comments
 (0)