Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 394 for setTypes (0.11 sec)

  1. src/encoding/binary/binary_test.go

    }
    
    func BenchmarkPutUint16(b *testing.B) {
    	b.SetBytes(2)
    	for i := 0; i < b.N; i++ {
    		BigEndian.PutUint16(putbuf[:2], uint16(i))
    	}
    }
    
    func BenchmarkAppendUint16(b *testing.B) {
    	b.SetBytes(2)
    	for i := 0; i < b.N; i++ {
    		putbuf = BigEndian.AppendUint16(putbuf[:0], uint16(i))
    	}
    }
    
    func BenchmarkPutUint32(b *testing.B) {
    	b.SetBytes(4)
    	for i := 0; i < b.N; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 19:16:18 UTC 2024
    - 25.4K bytes
    - Viewed (0)
  2. internal/config/cache/remote_gen_test.go

    	bts := make([]byte, 0, v.Msgsize())
    	bts, _ = v.MarshalMsg(bts[0:0])
    	b.SetBytes(int64(len(bts)))
    	b.ReportAllocs()
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		bts, _ = v.MarshalMsg(bts[0:0])
    	}
    }
    
    func BenchmarkUnmarshalCondCheck(b *testing.B) {
    	v := CondCheck{}
    	bts, _ := v.MarshalMsg(nil)
    	b.ReportAllocs()
    	b.SetBytes(int64(len(bts)))
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed Nov 22 21:46:17 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/typecheck/expr.go

    	if t == nil || r.Type() == nil {
    		n.SetType(nil)
    		return n
    	}
    	switch t.Kind() {
    	default:
    		base.Errorf("invalid operation: %v (type %v does not support indexing)", n, t)
    		n.SetType(nil)
    		return n
    
    	case types.TSTRING, types.TARRAY, types.TSLICE:
    		n.Index = indexlit(n.Index)
    		if t.IsString() {
    			n.SetType(types.ByteType)
    		} else {
    			n.SetType(t.Elem())
    		}
    		why := "string"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  4. cmd/metacache_gen_test.go

    	bts := make([]byte, 0, v.Msgsize())
    	bts, _ = v.MarshalMsg(bts[0:0])
    	b.SetBytes(int64(len(bts)))
    	b.ReportAllocs()
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		bts, _ = v.MarshalMsg(bts[0:0])
    	}
    }
    
    func BenchmarkUnmarshalmetacache(b *testing.B) {
    	v := metacache{}
    	bts, _ := v.MarshalMsg(nil)
    	b.ReportAllocs()
    	b.SetBytes(int64(len(bts)))
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Apr 23 18:58:53 UTC 2021
    - 2.3K bytes
    - Viewed (0)
  5. cmd/metrics-v2_gen_test.go

    	bts := make([]byte, 0, v.Msgsize())
    	bts, _ = v.MarshalMsg(bts[0:0])
    	b.SetBytes(int64(len(bts)))
    	b.ReportAllocs()
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		bts, _ = v.MarshalMsg(bts[0:0])
    	}
    }
    
    func BenchmarkUnmarshalMetricDescription(b *testing.B) {
    	v := MetricDescription{}
    	bts, _ := v.MarshalMsg(nil)
    	b.ReportAllocs()
    	b.SetBytes(int64(len(bts)))
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sun Mar 10 09:15:15 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  6. src/crypto/internal/nistec/nistec_test.go

    			if _, err := nistec.NewP521Point().SetBytes(out); err != nil {
    				t.Fatal(err)
    			}
    			out = p.BytesCompressed()
    			if _, err := p.SetBytes(out); err != nil {
    				t.Fatal(err)
    			}
    		}); allocs > 0 {
    			t.Errorf("expected zero allocations, got %0.1f", allocs)
    		}
    	})
    }
    
    type nistPoint[T any] interface {
    	Bytes() []byte
    	SetGenerator() T
    	SetBytes([]byte) (T, error)
    	Add(T, T) T
    	Double(T) T
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 12 18:48:23 UTC 2023
    - 8.4K bytes
    - Viewed (0)
  7. src/crypto/elliptic/nistec.go

    	byteLen := (curve.params.BitSize + 7) / 8
    	x = new(big.Int).SetBytes(data[1 : 1+byteLen])
    	y = new(big.Int).SetBytes(data[1+byteLen:])
    	return x, y
    }
    
    func (curve *nistCurve[Point]) UnmarshalCompressed(data []byte) (x, y *big.Int) {
    	if len(data) == 0 || (data[0] != 2 && data[0] != 3) {
    		return nil, nil
    	}
    	p, err := curve.newPoint().SetBytes(data)
    	if err != nil {
    		return nil, nil
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 21 16:19:34 UTC 2022
    - 9.6K bytes
    - Viewed (0)
  8. src/mime/type_test.go

    	}
    }
    
    func TestExtensionsByType(t *testing.T) {
    	cleanup := setMimeInit(func() {
    		clearMimeTypes()
    		setType(".gif", "image/gif")
    		setType(".a", "foo/letter")
    		setType(".b", "foo/letter")
    		setType(".B", "foo/letter")
    		setType(".PNG", "image/png")
    	})
    	defer cleanup()
    
    	tests := []struct {
    		typ     string
    		want    []string
    		wantErr string
    	}{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 08 21:09:03 UTC 2022
    - 4.9K bytes
    - Viewed (0)
  9. src/crypto/internal/edwards25519/field/fe_test.go

    	}
    }
    
    func TestSetBytesRoundTrip(t *testing.T) {
    	f1 := func(in [32]byte, fe Element) bool {
    		fe.SetBytes(in[:])
    
    		// Mask the most significant bit as it's ignored by SetBytes. (Now
    		// instead of earlier so we check the masking in SetBytes is working.)
    		in[len(in)-1] &= (1 << 7) - 1
    
    		return bytes.Equal(in[:], fe.Bytes()) && isInBounds(&fe)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 17:26:17 UTC 2023
    - 13.9K bytes
    - Viewed (0)
  10. cmd/tier_gen_test.go

    	bts := make([]byte, 0, v.Msgsize())
    	bts, _ = v.MarshalMsg(bts[0:0])
    	b.SetBytes(int64(len(bts)))
    	b.ReportAllocs()
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		bts, _ = v.MarshalMsg(bts[0:0])
    	}
    }
    
    func BenchmarkUnmarshalTierConfigMgr(b *testing.B) {
    	v := TierConfigMgr{}
    	bts, _ := v.MarshalMsg(nil)
    	b.ReportAllocs()
    	b.SetBytes(int64(len(bts)))
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Apr 23 18:58:53 UTC 2021
    - 2.3K bytes
    - Viewed (0)
Back to top