Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for BinarySearchFunc (0.1 sec)

  1. src/archive/zip/reader.go

    func (r *Reader) openReadDir(dir string) []fileListEntry {
    	files := r.fileList
    	i, _ := slices.BinarySearchFunc(files, dir, func(a fileListEntry, dir string) int {
    		idir, _, _ := split(a.name)
    		if dir != idir {
    			return strings.Compare(idir, dir)
    		}
    		// find the first entry with dir
    		return +1
    	})
    	j, _ := slices.BinarySearchFunc(files, dir, func(a fileListEntry, dir string) int {
    		jdir, _, _ := split(a.name)
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Sat Aug 03 01:05:29 UTC 2024
    - 28.1K bytes
    - Viewed (0)
  2. src/bytes/example_test.go

    		// a not equal b
    	}
    }
    
    func ExampleCompare_search() {
    	// Binary search to find a matching byte slice.
    	var needle []byte
    	var haystack [][]byte // Assume sorted
    	_, found := slices.BinarySearchFunc(haystack, needle, bytes.Compare)
    	if found {
    		// Found it!
    	}
    }
    
    func ExampleContains() {
    	fmt.Println(bytes.Contains([]byte("seafood"), []byte("foo")))
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Aug 07 17:22:36 UTC 2024
    - 14.9K bytes
    - Viewed (0)
  3. src/archive/zip/zip_test.go

    	for i, l := 1, len(a); i < l; i *= 2 {
    		copy(a[i:], a[:i])
    	}
    }
    
    func (r *rleBuffer) ReadAt(p []byte, off int64) (n int, err error) {
    	if len(p) == 0 {
    		return
    	}
    	skipParts, _ := slices.BinarySearchFunc(r.buf, off, func(rb repeatedByte, off int64) int {
    		return cmp.Compare(rb.off+rb.n, off)
    	})
    	parts := r.buf[skipParts:]
    	if len(parts) > 0 {
    		skipBytes := off - parts[0].off
    		for _, part := range parts {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 19.6K bytes
    - Viewed (0)
  4. api/go1.21.txt

    pkg runtime, type PanicNilError struct #25448
    pkg runtime, type Pinner struct #46787
    pkg slices, func BinarySearch[$0 interface{ ~[]$1 }, $1 cmp.Ordered]($0, $1) (int, bool) #60091
    pkg slices, func BinarySearchFunc[$0 interface{ ~[]$1 }, $1 interface{}, $2 interface{}]($0, $2, func($1, $2) int) (int, bool) #60091
    pkg slices, func Clip[$0 interface{ ~[]$1 }, $1 interface{}]($0) $0 #57433
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Mon Aug 07 09:39:17 UTC 2023
    - 25.6K bytes
    - Viewed (0)
Back to top