// MakeVertexSlice allocates a new vertex array with specified capacity and returns a VertexSlice
// that points to it's first len elements.
//
// Note, that a vertex array is specialized for a specific shader and can't be used with another
// shader.
356525
func MakeVertexSlice(shader *Shader, len, cap int) *VertexSlice {
	if len > cap {
		panic("failed to make vertex slice: len > cap")
	}
	return &VertexSlice{
		va: newVertexArray(shader, cap),
		i:  0,
		j:  len,
	}
}
795665
func (set KeySet) ToSlice() []Key {
	keys := []Key{}

	for key := range set {
		keys = append(keys, key)
	}

	return keys
}
897114
func (d *ChainDescriber) MakeGraph() (osgraph.Graph, error) {
	g := osgraph.New()

	loaders := []GraphLoader{}
	for namespace := range d.namespaces {
		klog.V(4).Infof("Loading build configurations from %q", namespace)
		loaders = append(loaders, &bcLoader{namespace: namespace, lister: d.c})
	}
	loadingFuncs := []func() error{}
	for _, loader := range loaders {
		loadingFuncs = append(loadingFuncs, loader.Load)
	}

	if errs := parallel.Run(loadingFuncs...); len(errs) > 0 {
		return g, utilerrors.NewAggregate(errs)
	}

	for _, loader := range loaders {
		loader.AddToGraph(g)
	}

	buildedges.AddAllInputOutputEdges(g)

	return g, nil
}
876410
func toSlice(from []interface{}, ptr interface{}) {
	// Value of the pointer to the target
	obj := reflect.Indirect(reflect.ValueOf(ptr))
	// We can't just convert from interface{} to whatever the target is (diff memory layout),
	// so we need to create a New slice of the proper type and copy the values individually
	t := reflect.TypeOf(ptr).Elem()
	tt := t.Elem()
	slice := reflect.MakeSlice(t, len(from), len(from))
	// Copying the data, val is an addressable Pointer of the actual target type
	val := reflect.Indirect(reflect.New(tt))
	for i := 0; i < len(from); i++ {
		v := reflect.ValueOf(from[i])
		if v.IsValid() && v.Type().ConvertibleTo(tt) {
			val.Set(v.Convert(tt))
		} else {
			val.Set(reflect.Zero(tt))
		}
		slice.Index(i).Set(val)
	}
	// Ok now assign our slice to the target pointer
	obj.Set(slice)
}
383514
func addressableSlice(slice interface{}) reflect.Value {
	v := reflect.ValueOf(slice)
	p := reflect.New(v.Type())
	p.Elem().Set(v)
	return p.Elem()
}
698894
func OptServerTranslateFileMapSize(mapSize int) ServerOption {
	return func(s *Server) error {
		s.holder.translateFile = NewTranslateFile(OptTranslateFileMapSize(mapSize))
		return nil
	}
}
633078
func NewVertex(tags core.TagSlice) (*Vertex, error) {
	vertex := new(Vertex)

	vertex.InitBaseEntityParser()
	vertex.Update(map[int]core.TypeParser{
		10: core.NewFloatTypeParserToVar(&vertex.Location.X),
		20: core.NewFloatTypeParserToVar(&vertex.Location.Y),
		30: core.NewFloatTypeParserToVar(&vertex.Location.Z),
		40: core.NewFloatTypeParserToVar(&vertex.StartingWidth),
		41: core.NewFloatTypeParserToVar(&vertex.EndWidth),
		42: core.NewFloatTypeParserToVar(&vertex.Bulge),
		50: core.NewFloatTypeParserToVar(&vertex.CurveFitTangentDirection),
		70: core.NewIntTypeParser(func(flags int) {
			vertex.CreatedByCurveFitting = flags&extraVertexCurveFittingBit != 0
			vertex.CurveFitTangentDefined = flags&curveFitTangentDefinedBit != 0
			vertex.SplineVertex = flags&splineVertexCreatedBit != 0
			vertex.SplineFrameCtrlPoint = flags&splineFrameCtrlPointBit != 0
			vertex.Is3dPolylineVertex = flags&polylineVertex3dBit != 0
			vertex.Is3dPolylineMesh = flags&polygonMesh3dBit != 0
			vertex.IsPolyfaceMeshVertex = flags&polyfaceMeshVertexBit != 0
		}),
		91: core.NewIntTypeParserToVar(&vertex.Id),
	})

	err := vertex.Parse(tags)
	return vertex, err
}
124919
func bytePtrFromSlice(data []byte) (ptr *byte, size int) {
	size = len(data)
	if size > 0 {
		ptr = &data[0]
	}
	return
}
928801
func copyEnvVarSlice(in []corev1.EnvVar) []corev1.EnvVar {
	out := make([]corev1.EnvVar, len(in))
	copy(out, in)
	return out
}
86940
func cByteSlice(start unsafe.Pointer, size int) []byte {
	if start == nil || size <= 0 {
		return nil
	} else {
		// Slice from very large imaginary array in C memory
		return (*[1 << 30]byte)(start)[:size:size]
	}
}
1047328
func newElemTypeSlice(items ...interface{}) []reflect.Type {
	typeList := make([]reflect.Type, len(items))
	for i, item := range items {
		typeItem := reflect.TypeOf(item)
		if typeItem.Kind() == reflect.Ptr {
			typeList[i] = typeItem.Elem()
		}
	}
	return typeList
}
484921
func (c *Chunk) MakeRef(srcColIdx, dstColIdx int) {
	c.columns[dstColIdx] = c.columns[srcColIdx]
}
1194418
func (i *VertexIterator) NextVertex() string {
	bs, ok := i.Next()
	if !ok {
		return ""
	}
	return string(bs)
}
304394
func (s *SparseRange) ToSlice() (ret []uint32) {
	for _, itm := range s.Items {
		switch x := itm.RangeItem.(type) {
		case *RangeItem_Single:
			ret = append(ret, x.Single)
		case *RangeItem_Range:
			for i := x.Range.Low; i <= x.Range.High; i++ {
				ret = append(ret, i)
			}
		}
	}
	return
}
99427
func NewVertex(pub *btcec.PublicKey) Vertex {
	var v Vertex
	copy(v[:], pub.SerializeCompressed())
	return v
}
1005084
func (s CPUSet) ToSlice() []int {
	result := []int{}
	for cpu := range s.elems {
		result = append(result, cpu)
	}
	sort.Ints(result)
	return result
}
191665
func Float64Slice(v []float64) []*float64 {
	out := make([]*float64, len(v))
	for i := range v {
		out[i] = &v[i]
	}
	return out
}