Skip to content

Commit e1241a4

Browse files
committed
fix bad allocation
1 parent 08d3600 commit e1241a4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/besseli.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ function _besseli!(out::DenseVector{T}, nu::AbstractRange, x::T) where T
229229
end
230230
if k > 1
231231
out[k] = _besseli(nu[k], x)
232-
tmp = @view out[1:k+1]
233-
out[1:k+1] = besselk_down_recurrence!(tmp, x, nu[1:k+1])
232+
tmp = @view out[begin:k+1]
233+
besselk_down_recurrence!(tmp, x, nu[begin:k+1])
234234
return out
235235
else
236236
return out

src/besselk.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ function _besselk!(out::DenseVector{T}, nu::AbstractRange, x::T) where T
241241
if k < len
242242
out[k] = _besselk(nu[k], x)
243243
tmp = @view out[k-1:end]
244-
out[k-1:end] = besselk_up_recurrence!(tmp, x, nu[k-1:end])
244+
besselk_up_recurrence!(tmp, x, nu[k-1:end])
245245
return out
246246
else
247247
return out

0 commit comments

Comments
 (0)