// hasNonWhitespace reports whether s (assumed to be ASCII) contains at least
// one byte of non-whitespace.
974766
func hasNonWhitespace(s string) bool {
	for _, b := range s {
		switch b {
		// Encoded-words can only be separated by linear white spaces which does
		// not include vertical tabs (\v).
		case ' ', '\t', '\n', '\r':
		default:
			return true
		}
	}
	return false
}
477372
func hasNonNamespacedCapability(pod *v1.Pod) bool {
	for _, c := range pod.Spec.Containers {
		if c.SecurityContext != nil && c.SecurityContext.Capabilities != nil {
			for _, cap := range c.SecurityContext.Capabilities.Add {
				if cap == "MKNOD" || cap == "SYS_TIME" || cap == "SYS_MODULE" {
					return true
				}
			}
		}
	}

	return false
}
1208611
func (p *Parser) consumeWhitespace() {
	if tok, _, _ := p.Scan(); tok != WS {
		p.Unscan()
	}
}
1098701
func (v *Value) HasSpaces() bool {
	return v.Spaces != nil && len(*v.Spaces) > 0
}
416914
func (sm StringMap) HasKey(key string) bool {
	_, found := sm[key]
	return found
}
743644
func nextNonWhitespaceToken(decoder *xml.Decoder) (xml.Token, error) {
	for {
		tok, err := decoder.Token()
		if err != nil {
			return nil, err
		} else if chars, ok := tok.(xml.CharData); ok {
			strippedBytes := bytes.TrimSpace(chars)
			if len(strippedBytes) != 0 {
				return tok, nil
			}
		} else {
			return tok, nil
		}
	}
}
1229881
func allSpaceWithNewline(str string) bool {
	var seenNewline = false
	for _, ch := range str {
		if !unicode.IsSpace(ch) {
			return false
		}
		if isEndOfLine(ch) {
			seenNewline = true
		}
	}
	return seenNewline
}
621261
func (p *Lexer) WhiteSpace() bool {

	any := false
	for {
		c, _ := p.Byte()
		if c != 13 && c != 10 && c != 9 && c != 32 {
			break
		}
		any = true
	}

	p.UnreadByte()
	return any
}
162016
func SplitWhite(s string) ([]string, error) {
	reg, err := regexp.Compile("[ \t]+")
	if err != nil {
		return nil, err
	}
	s = reg.ReplaceAllString(s, " ")
	return strings.Split(s, " "), nil
}
252787
func LastIndexNonSpace(s string) int {
	for i := len(s) - 1; i >= 0; i-- {
		if !unibyte.IsSpace(s[i]) {
			return i
		}
	}

	return -1
}
1037148
func IndexNonSpace(s string) int {
	for i := range s {
		if !unibyte.IsSpace(s[i]) {
			return i
		}
	}

	return -1
}
812123
func (p *Parser) moveWhitespace() {
	for {
		if c := p.r.Peek(0); c != ' ' && c != '\n' && c != '\r' && c != '\t' {
			break
		}
		p.r.Move(1)
	}
}
1255137
func skipWhitespace(buf []byte, i int) int {
	for i < len(buf) {
		if buf[i] != ' ' && buf[i] != '\t' && buf[i] != 0 {
			break
		}
		i++
	}
	return i
}
1020464
func TrimWhitespace(b []byte) []byte {
	n := len(b)
	start := n
	for i := 0; i < n; i++ {
		if !IsWhitespace(b[i]) {
			start = i
			break
		}
	}
	end := n
	for i := n - 1; i >= start; i-- {
		if !IsWhitespace(b[i]) {
			end = i + 1
			break
		}
	}
	return b[start:end]
}
876877
func (l *lexer) maybeSpace() rune {
	for {
		n := l.next()
		if any(n, whitespace) {
			l.acceptRun(whitespace)
			l.emit(itemSpace)
		} else {
			return n
		}
	}
}
931037
func MergeSpace(s string, trim bool) string {
	space := false

	idx, end := 0, len(s)
	bs := make([]byte, end)
	for i := 0; i < end; i++ {
		if unibyte.IsSpace(s[i]) {
			space = true
		} else {
			if space && (!trim || idx != 0) {
				bs[idx] = ' '
				idx++
			}

			bs[idx] = s[i]
			idx++

			space = false
		}
	}

	if space && !trim {
		bs[idx] = ' '
		idx++
	}

	return string(bs[:idx])
}
1352190
func extractWhitespaceTag(message ValidMessage) (plain MessagePlaintext, versions int) {
	wsPos := bytes.Index(message, whitespaceTagHeader)
	currentData := message[wsPos+len(whitespaceTagHeader):]

	for {
		aw, r, has := nextAllWhite(currentData)
		if !has {
			break
		}
		currentData = r
		if bytes.Equal(aw, otrV3{}.whitespaceTag()) {
			versions |= (1 << 3)
		} else if bytes.Equal(aw, otrV2{}.whitespaceTag()) {
			versions |= (1 << 2)
		}
	}

	plain = makeCopy(append(message[:wsPos], currentData...))
	return
}