MCPcopy Create free account
hub / github.com/allegro/bigcache / peekCheckErr

Method peekCheckErr

queue/bytes_queue.go:218–232  ·  view source on GitHub ↗

peekCheckErr is identical to peek, but does not actually return any data

(index int)

Source from the content-addressed store, hash-verified

216
217// peekCheckErr is identical to peek, but does not actually return any data
218func (q *BytesQueue) peekCheckErr(index int) error {
219
220 if q.count == 0 {
221 return errEmptyQueue
222 }
223
224 if index <= 0 {
225 return errInvalidIndex
226 }
227
228 if index >= len(q.array) {
229 return errIndexOutOfBounds
230 }
231 return nil
232}
233
234// peek returns the data from index and the number of bytes to encode the length of the data in uvarint format
235func (q *BytesQueue) peek(index int) ([]byte, int, error) {

Callers 3

CheckGetMethod · 0.95
peekMethod · 0.95
TestPeekFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestPeekFunction · 0.76