Skip to content

Commit 9ce5ab9

Browse files
authored
Constprop in defaultderiv (#335)
* Constprop in defaultderiv * version bump to v0.7.56
1 parent 22a70ba commit 9ce5ab9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunBase"
22
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3-
version = "0.7.55"
3+
version = "0.7.56"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/Operators/banded/CalculusOperator.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ end
184184

185185

186186
## Map to canonical
187-
function DefaultDerivative(sp::Space, k::Number)
187+
@inline function _DefaultDerivative(sp::Space, k::Number)
188188
assert_integer(k)
189189
if typeof(canonicaldomain(sp)).name==typeof(domain(sp)).name
190190
# this is the normal default constructor
@@ -213,6 +213,12 @@ function DefaultDerivative(sp::Space, k::Number)
213213
end
214214
end
215215

216+
@static if VERSION >= v"1.8"
217+
Base.@constprop :aggressive DefaultDerivative(sp::Space, k::Number) =
218+
_DefaultDerivative(sp, k)
219+
else
220+
DefaultDerivative(sp::Space, k::Number) = _DefaultDerivative(sp, k)
221+
end
216222

217223
function DefaultIntegral(sp::Space, k::Number)
218224
assert_integer(k)

0 commit comments

Comments
 (0)