Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 356 for asSlice (0.13 sec)

  1. src/cmd/compile/internal/walk/walk.go

    		}
    
    		switch n.Op() {
    		default:
    			base.FatalfAt(n.Pos(), "mayCall %+v", n)
    
    		case ir.OCALLFUNC, ir.OCALLINTER,
    			ir.OUNSAFEADD, ir.OUNSAFESLICE:
    			return true
    
    		case ir.OINDEX, ir.OSLICE, ir.OSLICEARR, ir.OSLICE3, ir.OSLICE3ARR, ir.OSLICESTR,
    			ir.ODEREF, ir.ODOTPTR, ir.ODOTTYPE, ir.ODYNAMICDOTTYPE, ir.ODIV, ir.OMOD,
    			ir.OSLICE2ARR, ir.OSLICE2ARRPTR:
    			// These ops might panic, make sure they are done
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 20:56:00 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  2. src/slices/slices.go

    func ContainsFunc[S ~[]E, E any](s S, f func(E) bool) bool {
    	return IndexFunc(s, f) >= 0
    }
    
    // Insert inserts the values v... into s at index i,
    // returning the modified slice.
    // The elements at s[i:] are shifted up to make room.
    // In the returned slice r, r[i] == v[0],
    // and r[i+len(v)] == value originally at r[i].
    // Insert panics if i is out of range.
    // This function is O(len(s) + len(v)).
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 29 14:01:59 UTC 2024
    - 13.6K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go

    	i := c.Index()
    	if i < 0 {
    		panic("Delete node not contained in slice")
    	}
    	v := c.field()
    	l := v.Len()
    	reflect.Copy(v.Slice(i, l), v.Slice(i+1, l))
    	v.Index(l - 1).Set(reflect.Zero(v.Type().Elem()))
    	v.SetLen(l - 1)
    	c.iter.step--
    }
    
    // InsertAfter inserts n after the current Node in its containing slice.
    // If the current Node is not part of a slice, InsertAfter panics.
    // Apply does not walk n.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 12.2K bytes
    - Viewed (0)
  4. src/runtime/string.go

    // string and byte slice both refer to the same storage.
    // The storage is not zeroed. Callers should use
    // b to set the string contents and then drop b.
    func rawstring(size int) (s string, b []byte) {
    	p := mallocgc(uintptr(size), nil, false)
    	return unsafe.String((*byte)(p), size), unsafe.Slice((*byte)(p), size)
    }
    
    // rawbyteslice allocates a new byte slice. The byte slice is not zeroed.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:17:26 UTC 2024
    - 13.4K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/storage/cacher/caching_object.go

    		result.raw = buffer.Bytes()
    	})
    	// Once invoked, fields of serialization will not change.
    	if result.err != nil {
    		return result.err
    	}
    	if b, support := w.(runtime.Splice); support {
    		b.Splice(result.raw)
    		return nil
    	}
    	_, err := w.Write(result.raw)
    	return err
    }
    
    // GetObject implements runtime.CacheableObject interface.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jun 05 18:03:48 UTC 2023
    - 12.6K bytes
    - Viewed (0)
  6. src/internal/types/testdata/check/expr3.go

    	_ = a[:10:10]
    	_ = a[:11 /* ERRORx `index .* out of bounds` */ :10]
    	_ = a[:10:11 /* ERRORx `index .* out of bounds` */ ]
    	_ = a[10:0 /* ERROR "invalid slice indices" */ :10]
    	_ = a[0:10:0 /* ERROR "invalid slice indices" */ ]
    	_ = a[10:0 /* ERROR "invalid slice indices" */:0]
    	_ = &a /* ERROR "cannot take address" */ [:10]
    
    	pa := &a
    	_ = pa[9]
    	_ = pa[10 /* ERRORx `index .* out of bounds` */ ]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 16 22:41:49 UTC 2023
    - 15.6K bytes
    - Viewed (0)
  7. pkg/proxy/config/config_test.go

    	namespacedName := types.NamespacedName{Namespace: slice.Namespace, Name: slice.Name}
    	h.state[namespacedName] = slice
    	h.sendEndpointSlices()
    }
    
    func (h *EndpointSliceHandlerMock) OnEndpointSliceDelete(slice *discoveryv1.EndpointSlice) {
    	h.lock.Lock()
    	defer h.lock.Unlock()
    	namespacedName := types.NamespacedName{Namespace: slice.Namespace, Name: slice.Name}
    	delete(h.state, namespacedName)
    	h.sendEndpointSlices()
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 22 05:08:41 UTC 2024
    - 14.3K bytes
    - Viewed (0)
  8. src/go/types/subst.go

    		}
    
    	case *Array:
    		elem := subst.typOrNil(t.elem)
    		if elem != t.elem {
    			return &Array{len: t.len, elem: elem}
    		}
    
    	case *Slice:
    		elem := subst.typOrNil(t.elem)
    		if elem != t.elem {
    			return &Slice{elem: elem}
    		}
    
    	case *Struct:
    		if fields, copied := subst.varList(t.fields); copied {
    			s := &Struct{fields: fields, tags: t.tags}
    			s.markComplete()
    			return s
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:04:07 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/ssa/decompose.go

    				}
    				f.NamedValues[*ptrName] = append(f.NamedValues[*ptrName], v.Args[0])
    				f.NamedValues[*lenName] = append(f.NamedValues[*lenName], v.Args[1])
    				toDelete = append(toDelete, namedVal{i, j})
    			}
    		case t.IsSlice():
    			ptrName, lenName, capName := f.SplitSlice(name)
    			newNames = maybeAppend2(f, newNames, ptrName, lenName)
    			newNames = maybeAppend(f, newNames, capName)
    			for j, v := range f.NamedValues[*name] {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 23 21:22:15 UTC 2022
    - 13.4K bytes
    - Viewed (0)
  10. tests/create_test.go

    		CheckPet(t, pet2, pet)
    	})
    
    	t.Run("Slice", func(t *testing.T) {
    		pets := []Pet{{
    			Name: "PolymorphicHasOne-Slice-1",
    			Toy:  Toy{Name: "Toy-PolymorphicHasOne-Slice-1"},
    		}, {
    			Name: "PolymorphicHasOne-Slice-2",
    			Toy:  Toy{Name: "Toy-PolymorphicHasOne-Slice-2"},
    		}, {
    			Name: "PolymorphicHasOne-Slice-3",
    			Toy:  Toy{Name: "Toy-PolymorphicHasOne-Slice-3"},
    		}}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Tue Mar 19 03:50:28 UTC 2024
    - 26.4K bytes
    - Viewed (0)
Back to top