Skip to content

Commit 9c9c7a2

Browse files
authored
Remove differentiation code for pre v0.7 (#203)
1 parent 0d3ee07 commit 9c9c7a2

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

src/differentiation.jl

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,23 +87,10 @@ differentiate(p::AbstractArray, x::Union{AbstractArray, Tuple}, deg::Int) = _dif
8787
differentiate(p, x, ::Val{0}) = p
8888
differentiate(p, x, ::Val{1}) = differentiate(p, x)
8989

90-
@static if VERSION < v"v0.7.0-"
91-
# Marking this @pure helps julia v0.6 figure this out
92-
Base.@pure _reduce_degree(::Val{N}) where {N} = Val{N - 1}()
93-
function differentiate(p, x, deg::Val{N}) where N
94-
if N < 0
95-
throw(DomainError(deg))
96-
else
97-
differentiate(differentiate(p, x), x, _reduce_degree(deg))
98-
end
99-
end
100-
else
101-
# In Julia v0.7 and above, we can remove the _reduce_degree trick
102-
function differentiate(p, x, deg::Val{N}) where N
103-
if N < 0
104-
throw(DomainError(deg))
105-
else
106-
differentiate(differentiate(p, x), x, Val{N - 1}())
107-
end
90+
function differentiate(p, x, deg::Val{N}) where N
91+
if N < 0
92+
throw(DomainError(deg))
93+
else
94+
differentiate(differentiate(p, x), x, Val{N - 1}())
10895
end
10996
end

0 commit comments

Comments
 (0)