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

Method skipSpaces

xmlparser/decoder.go:650–678  ·  view source on GitHub ↗

skipSpaces skips whitespace characters.

()

Source from the content-addressed store, hash-verified

648
649// skipSpaces skips whitespace characters.
650func (d *Decoder) skipSpaces() bool {
651 for {
652 b, ok := d.mustPeekBuffered()
653 if !ok {
654 return false
655 }
656
657 found := false
658 for i, c := range b {
659 if !isSpace(c) {
660 // Found a non-space byte.
661 // Trim the bytes up to (but not including) this byte.
662 b = b[:i]
663 found = true
664 break
665 }
666 }
667
668 // Discard the spaces we've read.
669 if !d.discard(len(b)) {
670 return false
671 }
672
673 if found {
674 // We've skipped all spaces, break the loop.
675 return true
676 }
677 }
678}
679
680// isSpace checks if a byte is a whitespace character.
681func isSpace(b byte) bool {

Callers 2

readStartTagMethod · 0.95
readEndTagMethod · 0.95

Calls 3

mustPeekBufferedMethod · 0.95
discardMethod · 0.95
isSpaceFunction · 0.85

Tested by

no test coverage detected