MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / discard

Method discard

xmlparser/decoder.go:848–860  ·  view source on GitHub ↗

discard discards the next n bytes from the reader.

(n int)

Source from the content-addressed store, hash-verified

846
847// discard discards the next n bytes from the reader.
848func (d *Decoder) discard(n int) bool {
849 // Peek bytes we want to discard to count new lines.
850 if b, err := d.r.Peek(n); err == nil {
851 d.countNewLines(b)
852 }
853
854 _, err := d.r.Discard(n)
855 if err != nil {
856 d.err = err
857 return false
858 }
859 return true
860}
861
862// countNewLines counts the number of new lines in the given byte slice
863// and increments the decoder's line counter accordingly.

Callers 7

checkBOMMethod · 0.95
readStartTagMethod · 0.95
readEndTagMethod · 0.95
readProcInstMethod · 0.95
skipSpacesMethod · 0.95
checkAndDiscardPrefixMethod · 0.95
mustReadWhileFnMethod · 0.95

Calls 2

countNewLinesMethod · 0.95
PeekMethod · 0.65

Tested by

no test coverage detected