Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for searchInts (0.18 sec)

  1. src/go/token/position_bench_test.go

    )
    
    func BenchmarkSearchInts(b *testing.B) {
    	data := make([]int, 10000)
    	for i := 0; i < 10000; i++ {
    		data[i] = i
    	}
    	const x = 8
    	if r := searchInts(data, x); r != x {
    		b.Errorf("got index = %d; want %d", r, x)
    	}
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		searchInts(data, x)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 23 01:37:31 UTC 2021
    - 484 bytes
    - Viewed (0)
  2. src/sort/example_search_test.go

    // This example demonstrates searching for int in a list sorted in ascending order.
    func ExampleSearchInts() {
    	a := []int{1, 2, 3, 4, 6, 7, 8}
    
    	x := 2
    	i := sort.SearchInts(a, x)
    	fmt.Printf("found %d at index %d in %v\n", x, i, a)
    
    	x = 5
    	i = sort.SearchInts(a, x)
    	fmt.Printf("%d not found, can be inserted at index %d in %v\n", x, i, a)
    	// Output:
    	// found 2 at index 1 in [1 2 3 4 6 7 8]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 18 08:25:24 UTC 2021
    - 2.1K bytes
    - Viewed (0)
  3. src/sort/search.go

    	return i, i < n && cmp(i) == 0
    }
    
    // Convenience wrappers for common cases.
    
    // SearchInts searches for x in a sorted slice of ints and returns the index
    // as specified by [Search]. The return value is the index to insert x if x is
    // not present (it could be len(a)).
    // The slice must be sorted in ascending order.
    func SearchInts(a []int, x int) int {
    	return Search(len(a), func(i int) bool { return a[i] >= x })
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 28 16:40:32 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  4. src/sort/search_test.go

    var fdata = []float64{0: -3.14, 1: 0, 2: 1, 3: 2, 4: 1000.7}
    var sdata = []string{0: "f", 1: "foo", 2: "foobar", 3: "x"}
    
    var wrappertests = []struct {
    	name   string
    	result int
    	i      int
    }{
    	{"SearchInts", SearchInts(data, 11), 8},
    	{"SearchFloat64s", SearchFloat64s(fdata, 2.1), 4},
    	{"SearchStrings", SearchStrings(sdata, ""), 0},
    	{"IntSlice.Search", IntSlice(data).Search(0), 2},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 07 14:42:13 UTC 2022
    - 6.8K bytes
    - Viewed (0)
  5. src/go/token/position.go

    	f.mutex.Lock()
    	filename = f.name
    	if i := searchInts(f.lines, offset); i >= 0 {
    		line, column = i+1, offset-f.lines[i]+1
    	}
    	if adjusted && len(f.infos) > 0 {
    		// few files have extra line infos
    		if i := searchLineInfos(f.infos, offset); i >= 0 {
    			alt := &f.infos[i]
    			filename = alt.Filename
    			if i := searchInts(f.lines, alt.Offset); i >= 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 19.7K bytes
    - Viewed (0)
  6. src/main/java/org/codelibs/fess/rank/fusion/DefaultSearcher.java

            final SearchResultBuilder builder = SearchResult.create();
            searchResponseOpt.ifPresent(searchResponse -> {
                final SearchHits searchHits = searchResponse.getHits();
                builder.allRecordCount(searchHits.getTotalHits().value);
                builder.allRecordCountRelation(searchHits.getTotalHits().relation.toString());
                builder.queryTime(searchResponse.getTook().millis());
    
    Registered: Wed Jun 12 13:08:18 UTC 2024
    - Last Modified: Thu Feb 22 01:37:57 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  7. src/main/java/org/codelibs/fess/es/user/allcommon/EsAbstractBehavior.java

            try {
                while (scrollId != null) {
                    final SearchHits searchHits = getSearchHits(response);
                    final SearchHit[] hits = searchHits.getHits();
                    if (hits.length == 0) {
                        break;
                    }
    
                    if (!handler.apply(searchHits)) {
                        break;
                    }
    
    Registered: Wed Jun 12 13:08:18 UTC 2024
    - Last Modified: Thu Feb 22 01:37:57 UTC 2024
    - 26.4K bytes
    - Viewed (0)
  8. src/main/java/org/codelibs/fess/es/config/allcommon/EsAbstractBehavior.java

            try {
                while (scrollId != null) {
                    final SearchHits searchHits = getSearchHits(response);
                    final SearchHit[] hits = searchHits.getHits();
                    if (hits.length == 0) {
                        break;
                    }
    
                    if (!handler.apply(searchHits)) {
                        break;
                    }
    
    Registered: Wed Jun 12 13:08:18 UTC 2024
    - Last Modified: Thu Feb 22 01:37:57 UTC 2024
    - 26.4K bytes
    - Viewed (0)
  9. src/main/java/org/codelibs/fess/es/log/allcommon/EsAbstractBehavior.java

            try {
                while (scrollId != null) {
                    final SearchHits searchHits = getSearchHits(response);
                    final SearchHit[] hits = searchHits.getHits();
                    if (hits.length == 0) {
                        break;
                    }
    
                    if (!handler.apply(searchHits)) {
                        break;
                    }
    
    Registered: Wed Jun 12 13:08:18 UTC 2024
    - Last Modified: Thu Feb 22 01:37:57 UTC 2024
    - 26.4K bytes
    - Viewed (0)
  10. fess-crawler-es/src/main/java/org/codelibs/fess/crawler/service/impl/EsDataService.java

            try {
                while (scrollId != null) {
                    final SearchHits searchHits = response.getHits();
                    if (searchHits.getHits().length == 0) {
                        break;
                    }
    
                    for (final SearchHit searchHit : searchHits) {
                        final Map<String, Object> source = searchHit.getSourceAsMap();
    Registered: Wed Jun 12 15:17:51 UTC 2024
    - Last Modified: Thu Feb 22 01:36:27 UTC 2024
    - 8.3K bytes
    - Viewed (0)
Back to top