Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for decodeFast (0.24 sec)

  1. src/encoding/binary/binary.go

    	// Fast path for basic types and slices.
    	if n, _ := intDataSize(data); n != 0 {
    		bs := make([]byte, n)
    		if _, err := io.ReadFull(r, bs); err != nil {
    			return err
    		}
    
    		if decodeFast(bs, order, data) {
    			return nil
    		}
    	}
    
    	// Fallback to reflect-based decoding.
    	v := reflect.ValueOf(data)
    	size := -1
    	switch v.Kind() {
    	case reflect.Pointer:
    		v = v.Elem()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 17:29:31 UTC 2024
    - 23.4K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/runtime/embedded_test.go

    	if err != nil {
    		t.Fatalf("unexpected error: %v", err)
    	}
    	if errs := runtime.DecodeList(list, codec); len(errs) > 0 {
    		t.Fatalf("unexpected error: %v", errs)
    	}
    
    	list2, err := meta.ExtractList(list[3])
    	if err != nil {
    		t.Fatalf("unexpected error: %v", err)
    	}
    	if errs := runtime.DecodeList(list2, codec); len(errs) > 0 {
    		t.Fatalf("unexpected error: %v", errs)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 06 16:07:10 UTC 2020
    - 9.2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/test/runtime_helper_test.go

    				ContentType: runtime.ContentTypeJSON,
    			},
    		},
    	}
    
    	_, codecs := TestScheme()
    	Codec := apitesting.TestCodec(codecs, testapigroup.SchemeGroupVersion)
    
    	if errs := runtime.DecodeList(pl.Items, Codec); len(errs) != 0 {
    		t.Fatalf("unexpected error %v", errs)
    	}
    	if pod, ok := pl.Items[1].(*testapigroup.Carp); !ok || pod.Name != "test" {
    		t.Errorf("object not converted: %#v", pl.Items[1])
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Aug 01 19:31:12 UTC 2018
    - 1.5K bytes
    - Viewed (0)
  4. src/unicode/utf16/utf16_test.go

    				}
    			}
    		}
    		if j != len(tt.out) {
    			t.Errorf("#%d: EncodeRune didn't generate enough output", i)
    		}
    	}
    }
    
    type decodeTest struct {
    	in  []uint16
    	out []rune
    }
    
    var decodeTests = []decodeTest{
    	{[]uint16{1, 2, 3, 4}, []rune{1, 2, 3, 4}},
    	{[]uint16{0xffff, 0xd800, 0xdc00, 0xd800, 0xdc01, 0xd808, 0xdf45, 0xdbff, 0xdfff},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:08:48 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/runtime/helper.go

    			return obj, nil
    		}
    	}
    	return obj, nil
    }
    
    // DecodeList alters the list in place, attempting to decode any objects found in
    // the list that have the Unknown type. Any errors that occur are returned
    // after the entire list is processed. Decoders are tried in order.
    func DecodeList(objects []Object, decoders ...Decoder) []error {
    	errs := []error(nil)
    	for i, obj := range objects {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Dec 13 22:54:34 UTC 2023
    - 8.4K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers.go

    		return err
    	}
    
    	unstruct.Object = m
    
    	return nil
    }
    
    func (s unstructuredJSONScheme) decodeToList(data []byte, list *UnstructuredList) error {
    	type decodeList struct {
    		Items []gojson.RawMessage `json:"items"`
    	}
    
    	var dList decodeList
    	if err := json.Unmarshal(data, &dList); err != nil {
    		return err
    	}
    
    	if err := json.Unmarshal(data, &list.Object); err != nil {
    		return err
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jun 29 20:39:55 UTC 2023
    - 16.3K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apimachinery/pkg/test/apis_meta_v1_unstructed_unstructure_test.go

    			},
    			&unstructured.Unstructured{
    				Object: map[string]interface{}{
    					"kind":       "Foo",
    					"apiVersion": "Bar",
    					"test":       "value",
    				},
    			},
    		},
    	}
    	if errs := runtime.DecodeList(pl.Items, unstructured.UnstructuredJSONScheme); len(errs) == 1 {
    		t.Fatalf("unexpected error %v", errs)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 05 20:12:50 UTC 2022
    - 17.3K bytes
    - Viewed (0)
  8. staging/src/k8s.io/cli-runtime/pkg/resource/visitor.go

    			if !meta.IsListType(currObj) {
    				items = append(items, currObj)
    				continue
    			}
    
    			currItems, err := meta.ExtractList(currObj)
    			if err != nil {
    				return err
    			}
    			if errs := runtime.DecodeList(currItems, v.mapper.decoder); len(errs) > 0 {
    				return utilerrors.NewAggregate(errs)
    			}
    			itemsToProcess = append(itemsToProcess, currItems...)
    		}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 03 10:17:56 UTC 2023
    - 21.3K bytes
    - Viewed (0)
Back to top