Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 639 for maxint (0.12 sec)

  1. src/slices/slices.go

    // overflows.
    func Repeat[S ~[]E, E any](x S, count int) S {
    	if count < 0 {
    		panic("cannot be negative")
    	}
    
    	const maxInt = ^uint(0) >> 1
    	if hi, lo := bits.Mul(uint(len(x)), uint(count)); hi > 0 || lo > maxInt {
    		panic("the result of (len(x) * count) overflows")
    	}
    
    	newslice := make(S, len(x)*count)
    	n := copy(newslice, x)
    	for n < len(newslice) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 29 14:01:59 UTC 2024
    - 13.6K bytes
    - Viewed (0)
  2. src/strings/strings.go

    	case 0:
    		return ""
    	case 1:
    		return elems[0]
    	}
    
    	var n int
    	if len(sep) > 0 {
    		if len(sep) >= maxInt/(len(elems)-1) {
    			panic("strings: Join output length overflow")
    		}
    		n += len(sep) * (len(elems) - 1)
    	}
    	for _, elem := range elems {
    		if len(elem) > maxInt-n {
    			panic("strings: Join output length overflow")
    		}
    		n += len(elem)
    	}
    
    	var b Builder
    	b.Grow(n)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 16:48:16 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  3. src/internal/trace/base.go

    		return
    	}
    	// Find the range of IDs.
    	maxID := EI(0)
    	minID := ^EI(0)
    	for id := range d.sparse {
    		if id > maxID {
    			maxID = id
    		}
    		if id < minID {
    			minID = id
    		}
    	}
    	if maxID >= math.MaxInt {
    		// We can't create a slice big enough to hold maxID elements
    		return
    	}
    	// We're willing to waste at most 2x memory.
    	if int(maxID-minID) > max(len(d.sparse), 2*len(d.sparse)) {
    		return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  4. internal/s3select/sql/value_test.go

    			fields: fields{
    				value: []byte("+1"),
    			},
    			want:   1,
    			wantOK: true,
    		},
    		{
    			name: "maxint",
    			fields: fields{
    				value: []byte(strconv.FormatInt(math.MaxInt64, 10)),
    			},
    			want:   math.MaxInt64,
    			wantOK: true,
    		},
    		{
    			name: "minint",
    			fields: fields{
    				value: []byte(strconv.FormatInt(math.MinInt64, 10)),
    			},
    			want:   math.MinInt64,
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Mar 06 16:56:10 UTC 2023
    - 12.5K bytes
    - Viewed (0)
  5. src/bytes/buffer_test.go

    		if err := recover(); err != ErrTooLarge {
    			t.Errorf("after too-large Grow, recover() = %v; want %v", err, ErrTooLarge)
    		}
    	}()
    
    	buf := NewBuffer(make([]byte, 1))
    	const maxInt = int(^uint(0) >> 1)
    	buf.Grow(maxInt)
    }
    
    // Was a bug: used to give EOF reading empty slice at EOF.
    func TestReadEmptyAtEOF(t *testing.T) {
    	b := new(Buffer)
    	slice := make([]byte, 0)
    	n, err := b.Read(slice)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 13:31:36 UTC 2024
    - 18.6K bytes
    - Viewed (0)
  6. pkg/webhooks/validation/controller/controller.go

    	}
    
    	c.queue = controllers.NewQueue("validation",
    		controllers.WithReconciler(c.Reconcile),
    		// Webhook patching has to be retried forever. But the retries would be rate limited.
    		controllers.WithMaxAttempts(math.MaxInt),
    		// Retry with backoff. Failures could be from conflicts of other instances (quick retry helps), or
    		// longer lasting concerns which will eventually be retried on 1min interval.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 28 16:52:19 UTC 2024
    - 11.3K bytes
    - Viewed (0)
  7. src/strings/strings_test.go

    			if err == nil || !Contains(err.Error(), tt.errStr) {
    				t.Errorf("%s#%d got %q want %q", prefix, i, err, tt.errStr)
    			}
    		}
    	}
    
    	const maxInt = int(^uint(0) >> 1)
    
    	runTestCases("", []testCase{
    		0: {"--", -2147483647, "negative"},
    		1: {"", maxInt, ""},
    		2: {"-", 10, ""},
    		3: {"gopher", 0, ""},
    		4: {"-", -1, "negative"},
    		5: {"--", -102, "negative"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 12:58:37 UTC 2024
    - 53K bytes
    - Viewed (0)
  8. src/bytes/bytes_test.go

    				t.Errorf("%s#%d got %q want %q", prefix, i, err, tt.errStr)
    			}
    		}
    	}
    
    	const maxInt = int(^uint(0) >> 1)
    
    	runTestCases("", []testCase{
    		0: {"--", -2147483647, "negative"},
    		1: {"", maxInt, ""},
    		2: {"-", 10, ""},
    		3: {"gopher", 0, ""},
    		4: {"-", -1, "negative"},
    		5: {"--", -102, "negative"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 12:58:37 UTC 2024
    - 56.5K bytes
    - Viewed (0)
  9. src/encoding/gob/dec_helpers.go

    		}
    		if i >= len(slice) {
    			// This is a slice that we only partially allocated.
    			growSlice(v, &slice, length)
    		}
    		x := state.decodeInt()
    		// MinInt and MaxInt
    		if x < ^int64(^uint(0)>>1) || int64(^uint(0)>>1) < x {
    			error_(ovfl)
    		}
    		slice[i] = int(x)
    	}
    	return true
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 24 19:28:46 UTC 2023
    - 15.4K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/cel/types.go

    	"github.com/google/cel-go/common/types/traits"
    
    	exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
    	"google.golang.org/protobuf/proto"
    )
    
    const (
    	noMaxLength = math.MaxInt
    )
    
    // NewListType returns a parameterized list type with a specified element type.
    func NewListType(elem *DeclType, maxItems int64) *DeclType {
    	return &DeclType{
    		name:         "list",
    		ElemType:     elem,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 08 15:52:31 UTC 2023
    - 18K bytes
    - Viewed (0)
Back to top