Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for extendSlice (0.1 sec)

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

    			base.Errorf("%v can't be allocated in Go; it is incomplete (or unallocatable)", call.Type().Elem())
    		}
    		var r ir.Node
    		switch {
    		case isAppendOfMake(call):
    			// x = append(y, make([]T, y)...)
    			r = extendSlice(call, init)
    		case call.IsDDD:
    			r = appendSlice(call, init) // also works for append(slice, string).
    		default:
    			r = walkAppend(call, init, as)
    		}
    		as.Y = r
    		if r.Op() == ir.OAPPEND {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:09:06 UTC 2024
    - 20.3K bytes
    - Viewed (0)
  2. src/reflect/value.go

    		*p = growslice(t, *p, n)
    	}
    }
    
    // extendSlice extends a slice by n elements.
    //
    // Unlike Value.grow, which modifies the slice in place and
    // does not change the length of the slice in place,
    // extendSlice returns a new slice value with the length
    // incremented by the number of specified elements.
    func (v Value) extendSlice(n int) Value {
    	v.mustBeExported()
    	v.mustBe(Slice)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
Back to top