Skip to content

Commit

Permalink
drop a @inline
Browse files Browse the repository at this point in the history
  • Loading branch information
tiemvanderdeure committed Jan 16, 2025
1 parent 86a1fce commit 6a89f87
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cfvariable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ end
CFtransform(data,fv,scale_factor,add_offset,time_origin,time_factor,maskingvalue,DTcast)

# in-place version
@inline function CFtransformdata!(out,data::AbstractArray{T,N},fv,scale_factor,add_offset,time_origin,time_factor,maskingvalue) where {T,N}
function CFtransformdata!(out,data::AbstractArray{T,N},fv,scale_factor,add_offset,time_origin,time_factor,maskingvalue) where {T,N}
DTcast = eltype(out)
@inbounds @simd for i in eachindex(data)
out[i] = CFtransform(data[i],fv,scale_factor,add_offset,time_origin,time_factor,maskingvalue,DTcast)
Expand All @@ -387,6 +387,8 @@ end
# for arrays when the CF transformation does not change the element type
# to avoid the allocation of a new array
@inline function CFtransformdata(data::AbstractArray{T,N},fv,scale_factor,add_offset,time_origin,time_factor,maskingvalue,::Type{T}) where {T,N}
@show typeof(data)

return CFtransformdata!(data,data,fv,scale_factor,add_offset,time_origin,time_factor,maskingvalue)
end

Expand Down

0 comments on commit 6a89f87

Please sign in to comment.