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

Method Shift

html/buffer.go:101–110  ·  view source on GitHub ↗

Shift returns the first element and advances position.

()

Source from the content-addressed store, hash-verified

99
100// Shift returns the first element and advances position.
101func (z *TokenBuffer) Shift() *Token {
102 if z.pos >= len(z.buf) {
103 t := &z.buf[:1][0]
104 z.read(t)
105 return t
106 }
107 t := &z.buf[z.pos]
108 z.pos++
109 return t
110}
111
112// Attributes extracts the gives attribute hashes from a tag.
113// It returns in the same order pointers to the requested token data or nil.

Callers 2

MinifyMethod · 0.95
TestBufferFunction · 0.95

Calls 2

readMethod · 0.95
lenFunction · 0.85

Tested by 1

TestBufferFunction · 0.76