Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for decodeMap (0.15 sec)

  1. src/encoding/base64/base64.go

    	// Lift the nil check outside of the loop. enc.decodeMap is directly
    	// used later in this function, to let the compiler know that the
    	// receiver can't be nil.
    	_ = enc.decodeMap
    
    	si := 0
    	for strconv.IntSize >= 64 && len(src)-si >= 8 && len(dst)-n >= 8 {
    		src2 := src[si : si+8]
    		if dn, ok := assemble64(
    			enc.decodeMap[src2[0]],
    			enc.decodeMap[src2[1]],
    			enc.decodeMap[src2[2]],
    			enc.decodeMap[src2[3]],
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 17.6K bytes
    - Viewed (0)
  2. src/encoding/base32/base32.go

    		switch {
    		case encoder[i] == '\n' || encoder[i] == '\r':
    			panic("encoding alphabet contains newline character")
    		case e.decodeMap[encoder[i]] != invalidIndex:
    			panic("encoding alphabet includes duplicate symbols")
    		}
    		e.decodeMap[encoder[i]] = uint8(i)
    	}
    	return e
    }
    
    // StdEncoding is the standard base32 encoding, as defined in RFC 4648.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 16:25:54 UTC 2024
    - 15.9K bytes
    - Viewed (0)
  3. src/encoding/base64/base64_test.go

    			benchFunc(b, size)
    		})
    	}
    }
    
    func BenchmarkNewEncoding(b *testing.B) {
    	b.SetBytes(int64(len(Encoding{}.decodeMap)))
    	for i := 0; i < b.N; i++ {
    		e := NewEncoding(encodeStd)
    		for _, v := range e.decodeMap {
    			_ = v
    		}
    	}
    }
    
    func TestDecoderRaw(t *testing.T) {
    	source := "AAAAAA"
    	want := []byte{0, 0, 0, 0}
    
    	// Direct.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Sep 03 18:57:29 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  4. src/encoding/gob/decode.go

    	rt := ut.user
    	decoderMap, ok := dec.decoderCache[rt]
    	if !ok {
    		decoderMap = make(map[typeId]**decEngine)
    		dec.decoderCache[rt] = decoderMap
    	}
    	if enginePtr, ok = decoderMap[remoteId]; !ok {
    		// To handle recursive types, mark this engine as underway before compiling.
    		enginePtr = new(*decEngine)
    		decoderMap[remoteId] = enginePtr
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 07 19:10:23 UTC 2023
    - 40.1K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/modes_test.go

    var allEncModes = []cbor.EncMode{
    	modes.Encode,
    	modes.EncodeNondeterministic,
    }
    
    var decModeNames = map[cbor.DecMode]string{
    	modes.Decode:    "Decode",
    	modes.DecodeLax: "DecodeLax",
    }
    
    var allDecModes = []cbor.DecMode{
    	modes.Decode,
    	modes.DecodeLax,
    }
    
    func assertNilError(t *testing.T, e error) {
    	if e != nil {
    		t.Errorf("expected nil error, got: %v", e)
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 22 18:43:10 UTC 2024
    - 2K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/decode.go

    		// timestamps.
    		ByteStringToTime: cbor.ByteStringToTimeAllowed,
    	}.DecMode()
    	if err != nil {
    		panic(err)
    	}
    	return decode
    }()
    
    // DecodeLax is derived from Decode, but does not complain about unknown fields in the input.
    var DecodeLax cbor.DecMode = func() cbor.DecMode {
    	opts := Decode.DecOptions()
    	opts.ExtraReturnErrors &^= cbor.ExtraDecErrorUnknownField // clear bit
    	dm, err := opts.DecMode()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jun 10 14:03:36 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/cbor.go

    	var tm metav1.TypeMeta
    	// The input is expected to include additional map keys besides apiVersion and kind, so use
    	// lax mode for decoding into TypeMeta.
    	if err := modes.DecodeLax.Unmarshal(data, &tm); err != nil {
    		return nil, fmt.Errorf("unable to determine group/version/kind: %w", err)
    	}
    	actual := tm.GetObjectKind().GroupVersionKind()
    	return &actual, nil
    }
    
    type Serializer interface {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 13 14:57:12 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/arch/x86/x86asm/decode.go

    // since we don't care about, say, the distinction between m80dec and m80bcd.
    // Similarly, mm and mm1 have identical meaning, as do xmm and xmm1.
    
    type decodeOp uint16
    
    const (
    	xFail  decodeOp = iota // invalid instruction (return)
    	xMatch                 // completed match
    	xJump                  // jump to pc
    
    	xCondByte     // switch on instruction byte value
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 10 18:59:52 UTC 2023
    - 45.1K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/decode_test.go

    			},
    			assertOnError: assertNilError,
    		},
    	})
    
    	group(t, "map", []test{
    		{
    			name:          "reject duplicate negative int keys into struct",
    			modes:         []cbor.DecMode{modes.DecodeLax},
    			in:            hex("a220012002"), // {-1: 1, -1: 2}
    			into:          struct{}{},
    			assertOnError: assertIdenticalError(&cbor.DupMapKeyError{Key: int64(-1), Index: 1}),
    		},
    		{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 22 18:43:10 UTC 2024
    - 25.6K bytes
    - Viewed (0)
  10. src/encoding/gob/codec_test.go

    	// after []byte{0x01, 0x00} and reports an errBadType. Running
    	// d.Decode(&foo) again on exactly the same input sequence should
    	// give another errBadType, but instead caused a panic because
    	// decoderMap wasn't cleaned up properly after the first error.
    	for i := 0; i < 2; i++ {
    		var foo struct{}
    		err := d.Decode(&foo)
    		if err != errBadType {
    			t.Fatalf("decode: expected %s, got %s", errBadType, err)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Aug 19 23:03:14 UTC 2023
    - 36.9K bytes
    - Viewed (0)
Back to top