Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for MaxBruteForce (0.09 sec)

  1. src/bytes/bytes.go

    // It returns -1 if rune is not present in s.
    // If r is [utf8.RuneError], it returns the first instance of any
    // invalid UTF-8 byte sequence.
    func IndexRune(s []byte, r rune) int {
    	const haveFastIndex = bytealg.MaxBruteForce > 0
    	switch {
    	case 0 <= r && r < utf8.RuneSelf:
    		return IndexByte(s, byte(r))
    	case r == utf8.RuneError:
    		for i := 0; i < len(s); {
    			r1, n := utf8.DecodeRune(s[i:])
    			if r1 == utf8.RuneError {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Tue Sep 03 20:55:15 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  2. src/bytes/bytes_test.go

    	// test fallback to IndexRune
    	{"oxoxoxoxoxoxoxoxoxoxox☺", "☺", 22},
    	// invalid UTF-8 byte sequence (must be longer than bytealg.MaxBruteForce to
    	// test that we don't use IndexRune)
    	{"xx0123456789012345678901234567890123456789012345678901234567890120123456789012345678901234567890123456xxx\xed\x9f\xc0", "\xed\x9f\xc0", 105},
    }
    
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Mon Aug 19 19:09:04 UTC 2024
    - 61.2K bytes
    - Viewed (0)
Back to top