Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for IndexFunc (0.06 sec)

  1. src/bytes/bytes.go

    	if HasSuffix(s, suffix) {
    		return s[:len(s)-len(suffix)]
    	}
    	return s
    }
    
    // IndexFunc interprets s as a sequence of UTF-8-encoded code points.
    // It returns the byte index in s of the first Unicode
    // code point satisfying f(c), or -1 if none do.
    func IndexFunc(s []byte, f func(r rune) bool) int {
    	return indexFunc(s, f, true)
    }
    
    // LastIndexFunc interprets s as a sequence of UTF-8-encoded code points.
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Wed Sep 03 14:04:47 UTC 2025
    - 35.5K bytes
    - Viewed (0)
  2. cmd/erasure-healing-common.go

    		return checkPartVolumeNotFound
    	case errDiskNotFound:
    		return checkPartDiskNotFound
    	default:
    		return checkPartUnknown
    	}
    }
    
    func partNeedsHealing(partErrs []int) bool {
    	return slices.IndexFunc(partErrs, func(i int) bool { return i != checkPartSuccess && i != checkPartUnknown }) > -1
    }
    
    func countPartNotSuccess(partErrs []int) (c int) {
    	for _, pe := range partErrs {
    		if pe != checkPartSuccess {
    			c++
    Registered: Sun Sep 07 19:28:11 UTC 2025
    - Last Modified: Sun Mar 30 00:56:02 UTC 2025
    - 12K bytes
    - Viewed (0)
  3. src/bytes/example_test.go

    	// Output:
    	// 4
    	// -1
    }
    
    func ExampleIndexFunc() {
    	f := func(c rune) bool {
    		return unicode.Is(unicode.Han, c)
    	}
    	fmt.Println(bytes.IndexFunc([]byte("Hello, 世界"), f))
    	fmt.Println(bytes.IndexFunc([]byte("Hello, world"), f))
    	// Output:
    	// 7
    	// -1
    }
    
    func ExampleIndexAny() {
    	fmt.Println(bytes.IndexAny([]byte("chicken"), "aeiouy"))
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Mon May 12 16:07:54 UTC 2025
    - 16.5K bytes
    - Viewed (0)
  4. api/go1.21.txt

    pkg slices, func Grow[$0 interface{ ~[]$1 }, $1 interface{}]($0, int) $0 #57433
    pkg slices, func Index[$0 interface{ ~[]$1 }, $1 comparable]($0, $1) int #57433
    pkg slices, func IndexFunc[$0 interface{ ~[]$1 }, $1 interface{}]($0, func($1) bool) int #57433
    pkg slices, func Insert[$0 interface{ ~[]$1 }, $1 interface{}]($0, int, ...$1) $0 #57433
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Mon Aug 07 09:39:17 UTC 2023
    - 25.6K bytes
    - Viewed (0)
  5. src/archive/tar/reader.go

    			// For Format detection, check if block is properly formatted since
    			// the parser is more liberal than what USTAR actually permits.
    			notASCII := func(r rune) bool { return r >= 0x80 }
    			if bytes.IndexFunc(tr.blk[:], notASCII) >= 0 {
    				hdr.Format = FormatUnknown // Non-ASCII characters in block.
    			}
    			nul := func(b []byte) bool { return int(b[len(b)-1]) == 0 }
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Fri Mar 08 01:59:14 UTC 2024
    - 26.8K bytes
    - Viewed (0)
  6. src/bytes/bytes_test.go

    	{"a\xe0\x80cd", not(isValidRune), 1, 2},
    }
    
    func TestIndexFunc(t *testing.T) {
    	for _, tc := range indexFuncTests {
    		first := IndexFunc([]byte(tc.in), tc.f.f)
    		if first != tc.first {
    			t.Errorf("IndexFunc(%q, %s) = %d; want %d", tc.in, tc.f.name, first, tc.first)
    		}
    		last := LastIndexFunc([]byte(tc.in), tc.f.f)
    		if last != tc.last {
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Mon Jul 28 18:13:58 UTC 2025
    - 62.9K bytes
    - Viewed (0)
  7. cmd/sts-handlers_test.go

    		Policy: []string{policy},
    	})
    	if err != nil {
    		c.Fatalf("GetLDAPPolicyEntities should not fail: %v", err)
    	}
    	{
    		// Check that the mapping we created exists.
    		idx := slices.IndexFunc(policyResult.PolicyMappings, func(e madmin.PolicyEntities) bool {
    			return e.Policy == policy && slices.Contains(e.Groups, actualGroupDN)
    		})
    		if idx < 0 {
    Registered: Sun Sep 07 19:28:11 UTC 2025
    - Last Modified: Fri Aug 29 02:39:48 UTC 2025
    - 100.2K bytes
    - Viewed (1)
  8. cmd/erasure-object.go

    		// then add only one delete marker if requested
    		sort.SliceStable(fivs.Versions, func(i, j int) bool {
    			return !fivs.Versions[i].Deleted
    		})
    		if idx := slices.IndexFunc(fivs.Versions, func(fi FileInfo) bool {
    			return fi.Deleted
    		}); idx > -1 {
    			fivs.Versions = fivs.Versions[:idx+1]
    		}
    		dedupVersions = append(dedupVersions, fivs)
    	}
    
    Registered: Sun Sep 07 19:28:11 UTC 2025
    - Last Modified: Sun Sep 07 16:13:09 UTC 2025
    - 80.4K bytes
    - Viewed (0)
  9. api/go1.txt

    pkg bytes, func HasSuffix([]uint8, []uint8) bool
    pkg bytes, func Index([]uint8, []uint8) int
    pkg bytes, func IndexAny([]uint8, string) int
    pkg bytes, func IndexByte([]uint8, uint8) int
    pkg bytes, func IndexFunc([]uint8, func(int32) bool) int
    pkg bytes, func IndexRune([]uint8, int32) int
    pkg bytes, func Join([][]uint8, []uint8) []uint8
    pkg bytes, func LastIndex([]uint8, []uint8) int
    pkg bytes, func LastIndexAny([]uint8, string) int
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Wed Aug 14 18:58:28 UTC 2013
    - 1.7M bytes
    - Viewed (0)
Back to top