MCPcopy
hub / github.com/tdewolff/minify / Shift

Method Shift

xml/buffer.go:77–86  ·  view source on GitHub ↗

Shift returns the first element and advances position.

()

Source from the content-addressed store, hash-verified

75
76// Shift returns the first element and advances position.
77func (z *TokenBuffer) Shift() *Token {
78 if z.pos >= len(z.buf) {
79 t := &z.buf[:1][0]
80 z.read(t)
81 return t
82 }
83 t := &z.buf[z.pos]
84 z.pos++
85 return t
86}

Callers 2

TestBufferFunction · 0.95
MinifyMethod · 0.95

Calls 2

readMethod · 0.95
lenFunction · 0.85

Tested by 1

TestBufferFunction · 0.76