From 0fb27f8cb9da985ff514de0e2b3727726454026e Mon Sep 17 00:00:00 2001 From: Neven Sajko Date: Fri, 10 Jan 2025 14:12:32 +0100 Subject: [PATCH] move the `dataids` method to the main file I think this may be tidier. The `FixedSizeBitArray` method would presumably go right next to this one. --- src/FixedSizeArrays.jl | 8 ++++++++ src/collect_as.jl | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/FixedSizeArrays.jl b/src/FixedSizeArrays.jl index 440d91b..44d97b1 100644 --- a/src/FixedSizeArrays.jl +++ b/src/FixedSizeArrays.jl @@ -1,6 +1,14 @@ module FixedSizeArrays include("FixedSizeArray.jl") + +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): + # . + Base.dataids(a::FixedSizeArray) = Base.dataids(a.mem) +end + include("collect_as.jl") end # module FixedSizeArrays diff --git a/src/collect_as.jl b/src/collect_as.jl index 252b64d..d3acb0f 100644 --- a/src/collect_as.jl +++ b/src/collect_as.jl @@ -115,10 +115,3 @@ function collect_as(::Type{T}, iterator) where {T<:FixedSizeArray} len_stat = length_status(size_class) 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): - # . - Base.dataids(a::FixedSizeArray) = Base.dataids(a.mem) -end