Skip to content

Commit 26bbfc8

Browse files
authored
aggressive constprop in intpow (#206)
1 parent 8895033 commit 26bbfc8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Fun.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,12 @@ end
353353

354354
\(c::Number, f::Fun) = Fun(f.space, c \ f.coefficients)
355355

356-
357-
function intpow(f::Fun,k::Integer)
356+
@static if VERSION >= v"1.8"
357+
Base.@constprop :aggressive intpow(f::Fun, k::Integer) = _intpow(f, k)
358+
else
359+
intpow(f::Fun, k::Integer) = _intpow(f, k)
360+
end
361+
@inline function _intpow(f, k)
358362
if k == 0
359363
ones(cfstype(f), space(f))
360364
elseif k==1

0 commit comments

Comments
 (0)