- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for BinarySearchFunc (0.09 sec)
-
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) -
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)