Skip to content

Commit bf0f889

Browse files
authored
simplify some ranges used as indices (#450)
1 parent 497ae5f commit bf0f889

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Caching/almostbanded.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ function resizedata!(QR::QROperator{<:CachedOperator{T,<:AlmostBandedMatrix{T}}}
307307
normalize!(wp)
308308

309309
# scale banded entries
310-
for j = k:k+Ru
310+
for j = k.+(0:Ru)
311311
dind = Ru+1+k-j
312312
v = view(R.data, range(dind, length=M), j)
313313
dt = dot(wp,v)
@@ -329,7 +329,7 @@ function resizedata!(QR::QROperator{<:CachedOperator{T,<:AlmostBandedMatrix{T}}}
329329
# scale filled entries
330330

331331
for j = axes(F,2)
332-
v = view(F,k:k+M-1,j) # the k,jth entry of F
332+
v = view(F, range(k,length=M), j) # the k,jth entry of F
333333
dt = dot(wp,v)
334334
axpy!(-2dt,wp,v)
335335
end

src/Caching/banded.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function resizedata!(QR::QROperator{<:CachedOperator{T,<:BandedMatrix{T}}}, ::Co
7272
normalize!(wp)
7373

7474
# scale banded entries
75-
for j=k:k+Ru
75+
for j=k.+(0:Ru)
7676
dind=Ru+1+k-j
7777
v=view(R.data, range(dind, length=M), j)
7878
dt=dot(wp,v)

0 commit comments

Comments
 (0)