We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f84d7cf commit 5175551Copy full SHA for 5175551
src/buffer.jl
@@ -131,9 +131,7 @@ function unmark!(buf::Buffer)
131
end
132
133
function reset!(buf::Buffer)
134
- if buf.markpos == 0
135
- throw(ArgumentError("not marked"))
136
- end
+ @assert buf.markpos > 0
137
buf.bufferpos = buf.markpos
138
buf.markpos = 0
139
return buf.bufferpos
@@ -177,9 +175,7 @@ end
177
175
178
176
# Skip `n` bytes in the buffer.
179
function skipbuffer!(buf::Buffer, n::Integer)
180
- if n > buffersize(buf)
181
- throw(ArgumentError("too large skip size"))
182
+ @assert n ≤ buffersize(buf)
183
consumed!(buf, n)
184
return buf
185
0 commit comments