Skip to content

Commit c953d4b

Browse files
authored
Revert "work around a splatting penalty in twiceprecision (#29060)" (#36728)
But keep the test. This workaround is no longer required, because the compiler can now understand this pattern. This reverts commit 88d536a.
1 parent 47989fa commit c953d4b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

base/twiceprecision.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,11 @@ const F_or_FF = Union{AbstractFloat, Tuple{AbstractFloat,AbstractFloat}}
335335
asF64(x::AbstractFloat) = Float64(x)
336336
asF64(x::Tuple{AbstractFloat,AbstractFloat}) = Float64(x[1]) + Float64(x[2])
337337

338-
# Defined to prevent splatting in the function below which here has a performance impact
339-
_TP(x) = TwicePrecision{Float64}(x)
340-
_TP(x::Tuple{Any, Any}) = TwicePrecision{Float64}(x[1], x[2])
341338
function steprangelen_hp(::Type{Float64}, ref::F_or_FF,
342339
step::F_or_FF, nb::Integer,
343340
len::Integer, offset::Integer)
344-
StepRangeLen(_TP(ref),
345-
twiceprecision(_TP(step), nb), Int(len), offset)
341+
StepRangeLen(TwicePrecision{Float64}(ref...),
342+
twiceprecision(TwicePrecision{Float64}(step...), nb), Int(len), offset)
346343
end
347344

348345
function steprangelen_hp(::Type{T}, ref::F_or_FF,

0 commit comments

Comments
 (0)