Skip to content

Commit b882431

Browse files
Add @findmyway's feedback from previous PR
1 parent 7f5965f commit b882431

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/CircularArrayBuffers.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Base.isempty(cb::CircularArrayBuffer) = cb.nframes == 0
7979
"""
8080
_buffer_index(cb::CircularArrayBuffer, i::Int)
8181
82-
Return the index of the `i`-th element in the buffer.
82+
Return the index of the `i`-th element in the buffer. Note the `i` is assumed to be the linear indexing of `cb`.
8383
"""
8484
@inline function _buffer_index(cb::CircularArrayBuffer, i::Int)
8585
idx = (cb.first - 1) * cb.step_size + i
@@ -90,23 +90,23 @@ end
9090
"""
9191
wrap_index(idx, n)
9292
93-
Return the index of the `idx`-th element in the buffer, if index is one past the size, return 1, else error.
93+
Return the index of the `idx`-th element in the buffer, if index is one past the size, return 1, else error.
9494
"""
9595
function wrap_index(idx, n)
9696
if idx <= n
9797
return idx
9898
elseif idx <= 2n
9999
return idx - n
100100
else
101-
@info "oops! idx $(idx) > 2n $(2n)"
101+
@warn "oops! idx $(idx) > 2n $(2n)"
102102
return idx - n
103103
end
104104
end
105105

106106
"""
107107
_buffer_frame(cb::CircularArrayBuffer, i::Int)
108108
109-
Return the index of the `i`-th frame in the buffer.
109+
Here `i` is assumed to be the last dimension of `cb`. Each `frame` means a slice of the last dimension. Since we use *circular frames* (the `data` buffer) underlying, this function transforms the logical `i`-th frame to the real frame of the internal buffer.
110110
"""
111111
@inline function _buffer_frame(cb::CircularArrayBuffer, i::Int)
112112
n = capacity(cb)

0 commit comments

Comments
 (0)