Skip to content

Commit 68047aa

Browse files
committed
Apply suggestions
1 parent 397d8d1 commit 68047aa

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

test/runtests.jl

+1-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ struct Polynomial{T<:Real}
2525
coeffs::Vector{T}
2626
end
2727
Polynomial(args::T...) where {T<:Real} = Polynomial(collect(args))
28-
function (p::Polynomial)(x)
29-
n = length(p.coeffs) - 1
30-
sum(zip(p.coeffs, 0:n)) do (a, i)
31-
a * x^i
32-
end
33-
end
28+
(p::Polynomial)(x) = sum(a * x^(i-1) for (i, a) in enumerate(p.coeffs))
3429

3530
# list of tests
3631
testfiles = [

0 commit comments

Comments
 (0)