Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 221 for slice (0.96 sec)

  1. doc/next/6-stdlib/3-iter.md

    user-defined iterators.
    
    The [slices] package adds several functions that work with iterators:
    - [All](/pkg/slices#All) returns an iterator over slice indexes and values.
    - [Values](/pkg/slices#Values) returns an iterator over slice elements.
    - [Backward](/pkg/slices#Backward) returns an iterator that loops over
      a slice backward.
    - [Collect](/pkg/slices#Collect) collects values from an iterator into
      a new slice.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 18:34:13 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/sys/unix/sysvshm_unix.go

    	// Retrieve the size of the shared memory to enable slice creation
    	var info SysvShmDesc
    
    	_, err := SysvShmCtl(id, IPC_STAT, &info)
    	if err != nil {
    		// release the shared memory if we can't find the size
    
    		// ignoring error from shmdt as there's nothing sensible to return here
    		shmdt(addr)
    		return nil, err
    	}
    
    	// Use unsafe to convert addr into a []byte.
    	b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), int(info.Segsz))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 16:12:58 UTC 2024
    - 1.4K 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/cmd/compile/internal/walk/assign.go

    	nif.Cond = ir.NewBinaryExpr(base.Pos, ir.OLE, nuint, scapuint)
    	nif.Likely = true
    
    	// then { s = s[:newLen] }
    	slice := ir.NewSliceExpr(base.Pos, ir.OSLICE, s, nil, newLen, nil)
    	slice.SetBounded(true)
    	nif.Body = []ir.Node{ir.NewAssignStmt(base.Pos, s, slice)}
    
    	// else { s = growslice(oldPtr, newLen, oldCap, num, T) }
    	call := walkGrowslice(s, nif.PtrInit(), oldPtr, newLen, oldCap, num)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:09:06 UTC 2024
    - 20.3K bytes
    - Viewed (0)
  5. src/crypto/aes/aes_gcm.go

    }
    
    func (g *gcmAsm) Overhead() int {
    	return g.tagSize
    }
    
    // sliceForAppend takes a slice and a requested number of bytes. It returns a
    // slice with the contents of the given slice followed by that many bytes and a
    // second slice that aliases into it and contains only the extra bytes. If the
    // original slice has sufficient capacity then no allocation is performed.
    func sliceForAppend(in []byte, n int) (head, tail []byte) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 18:23:49 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  6. src/cmd/trace/gstate.go

    		panic("non-executing goroutine stopped")
    	}
    	ctx.Slice(traceviewer.SliceEvent{
    		Name:     gs.name(),
    		Ts:       ctx.elapsed(gs.startRunningTime),
    		Dur:      ts.Sub(gs.startRunningTime),
    		Resource: uint64(gs.executing),
    		Stack:    stk,
    	})
    
    	// Flush completed ranges.
    	for _, cr := range gs.completedRanges {
    		ctx.Slice(traceviewer.SliceEvent{
    			Name:     cr.name,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 11.9K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/text/language/coverage.go

    // creating Coverage implementations for partially defined data. Very often a
    // package will only need to define a subset of slices. coverage provides a
    // convenient way to do this. Moreover, packages using NewCoverage, instead of
    // their own implementation, will not break if later new slice types are added.
    type coverage struct {
    	tags    func() []Tag
    	bases   func() []Base
    	scripts func() []Script
    	regions func() []Region
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 24 13:01:26 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go

    	//  var i string
    	//  var _ = s[i]
    	InvalidIndex
    
    	// SwappedSliceIndices occurs when constant indices in a slice expression
    	// are decreasing in value.
    	//
    	// Example:
    	//  var _ = []int{1,2,3}[2:1]
    	SwappedSliceIndices
    
    	/* operators > slice */
    
    	// NonSliceableOperand occurs when a slice operation is applied to a value
    	// whose type is not sliceable, or is unaddressable.
    	//
    	// Example:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 34K bytes
    - Viewed (0)
  9. doc/go_spec.html

    The <i>capacity</i> is a measure of that extent: it is the sum of
    the length of the slice and the length of the array beyond the slice;
    a slice of length up to that capacity can be created by
    <a href="#Slice_expressions"><i>slicing</i></a> a new one from the original slice.
    The capacity of a slice <code>a</code> can be discovered using the
    built-in function <a href="#Length_and_capacity"><code>cap(a)</code></a>.
    </p>
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 21:07:21 UTC 2024
    - 281.5K bytes
    - Viewed (0)
  10. src/compress/bzip2/huffman.go

    	// of nodes to use when the tree is being constructed.
    	nodes    []huffmanNode
    	nextNode int
    }
    
    // A huffmanNode is a node in the tree. left and right contain indexes into the
    // nodes slice of the tree. If left or right is invalidNodeValue then the child
    // is a left node and its value is in leftValue/rightValue.
    //
    // The symbols are uint16s because bzip2 encodes not only MTF indexes in the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 17:44:37 UTC 2024
    - 6.7K bytes
    - Viewed (0)
Back to top