Skip to content

Commit

Permalink
Define Base.dataids method for FixedSizeArrays (#64)
Browse files Browse the repository at this point in the history
Co-authored-by: Neven Sajko <s@purelymail.com>
  • Loading branch information
giordano and nsajko authored Oct 7, 2024
1 parent c14fbe8 commit f62e401
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/FixedSizeArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -392,4 +392,11 @@ function collect_as(::Type{T}, iterator) where {T<:FixedSizeArray}
collect_as_fsa_checked(iterator, spec, dim_count, len_stat)::T
end

if isdefined(Base, :dataids) && (Base.dataids isa Function)
# This is an internal, non-public function which is nevertheless needed to
# get good performance in some cases (e.g. broadcasting):
# <https://github.com/JuliaArrays/FixedSizeArrays.jl/issues/63>.
Base.dataids(a::FixedSizeArray) = Base.dataids(a.mem)
end

end # module FixedSizeArrays

0 comments on commit f62e401

Please sign in to comment.