// ToSlice returns a slice backed by the elements
// of the MembershipStore
430283
func (m *MembershipStore) ToSlice() []*proto.SignedGossipMessage {
	m.RLock()
	defer m.RUnlock()
	members := make([]*proto.SignedGossipMessage, len(m.m))
	i := 0
	for _, member := range m.m {
		members[i] = member
		i++
	}
	return members
}
487835
func makeErrorSlice(len int, e error) []error {
	errors := make([]error, len)
	for inx := 0; inx < len; inx = inx + 1 {
		errors[inx] = e
	}
	return errors
}
1044965
func packBytesSlice(bytes []byte, l int) []byte {
	len := packNum(reflect.ValueOf(l))
	return append(len, common.RightPadBytes(bytes, (l+31)/32*32)...)
}
853205
func (s *Sensu) GetStashesSlice(limit int, offset int) ([]interface{}, error) {
	return s.getList(fmt.Sprintf("stashes"), limit, offset)
}
979996
func removeElementFromStringSlice(list []string, elem string) []string {
	for i, e := range list {
		if e == elem {
			return append(list[:i], list[i+1:]...)
		}
	}
	return list
}
1345937
func (list *List) Slice(from, to int) []string {
	if list.length == 0 {
		return emptySlice()
	}
	if from >= list.length || to >= list.length || from < 0 || to < 0 || from > to {
		return emptySlice()
	}
	if from == to {
		return oneSlice(list.Get(from))
	}
	diff := to - from + 1
	result := make([]string, diff)
	tmp := list.first
	for i := 0; i < list.length; i++ {
		if i >= from && i <= to {
			result[i-from] = tmp.Content
		}
		if i >= to {
			break
		}
		tmp = tmp.Next
	}
	return result
}
935989
func IntSlice(s Interface) []int {
	slice := make([]int, 0)
	for _, item := range s.List() {
		v, ok := item.(int)
		if !ok {
			continue
		}

		slice = append(slice, v)
	}
	return slice
}
1295138
func (s *StateSnapshot) DenormalizeAllocationSlice(allocs []*structs.Allocation, job *structs.Job) ([]*structs.Allocation, error) {
	allocDiffs := make([]*structs.AllocationDiff, len(allocs))
	for i, alloc := range allocs {
		allocDiffs[i] = alloc.AllocationDiff()
	}

	return s.DenormalizeAllocationDiffSlice(allocDiffs, job)
}
1217095
func NewStringSlice(val []string, p *[]string) *StringSliceValue {
	*p = val
	return (*StringSliceValue)(p)
}
1374282
func (set LiteralFieldSet) ToSlice() []LiteralField {
	var s []LiteralField
	for v := range set {
		s = append(s, v)
	}
	return s
}
316164
func (l *Language) GetStringSlice(key string) []string {
	return cast.ToStringSlice(l.Get(key))
}
528995
func ptrUcs2Slice(ptr *uint16, lenUcs2 int) []uint16 {
	return *(*[]uint16)(unsafe.Pointer(&reflect.SliceHeader{
		Data: uintptr(unsafe.Pointer(ptr)),
		Len:  lenUcs2,
		Cap:  lenUcs2}))
}
1323477
func alphabetSlice(from, to byte) (string, error) {
	leftPos := strings.Index(ASCII, string(from))
	rightPos := strings.LastIndex(ASCII, string(to))
	if leftPos > rightPos {
		return "", fmt.Errorf("invalid range specified: %s-%s", string(from), string(to))
	}
	return ASCII[leftPos:rightPos], nil
}
383514
func addressableSlice(slice interface{}) reflect.Value {
	v := reflect.ValueOf(slice)
	p := reflect.New(v.Type())
	p.Elem().Set(v)
	return p.Elem()
}
368541
func copySlice(slice []byte) []byte {
	ret := make([]byte, len(slice))
	copy(ret, slice)
	return ret
}
651635
func (s *Snmp) ToSlice() []string {
	snmp := s.Copy()
	return []string{
		fmt.Sprint(snmp.BytesSent),
		fmt.Sprint(snmp.BytesReceived),
		fmt.Sprint(snmp.MaxConn),
		fmt.Sprint(snmp.ActiveOpens),
		fmt.Sprint(snmp.PassiveOpens),
		fmt.Sprint(snmp.CurrEstab),
		fmt.Sprint(snmp.InErrs),
		fmt.Sprint(snmp.InCsumErrors),
		fmt.Sprint(snmp.KCPInErrors),
		fmt.Sprint(snmp.InPkts),
		fmt.Sprint(snmp.OutPkts),
		fmt.Sprint(snmp.InSegs),
		fmt.Sprint(snmp.OutSegs),
		fmt.Sprint(snmp.InBytes),
		fmt.Sprint(snmp.OutBytes),
		fmt.Sprint(snmp.RetransSegs),
		fmt.Sprint(snmp.FastRetransSegs),
		fmt.Sprint(snmp.EarlyRetransSegs),
		fmt.Sprint(snmp.LostSegs),
		fmt.Sprint(snmp.RepeatSegs),
		fmt.Sprint(snmp.FECParityShards),
		fmt.Sprint(snmp.FECErrs),
		fmt.Sprint(snmp.FECRecovered),
		fmt.Sprint(snmp.FECShortShards),
	}
}
895830
func coordSlice(cs *coordSeq) ([]Coord, error) {
	size, err := cs.size()
	if err != nil {
		return nil, err
	}
	coords := make([]Coord, size)
	for i := 0; i < size; i++ {
		x, err := cs.x(i)
		if err != nil {
			return nil, err
		}
		y, err := cs.y(i)
		if err != nil {
			return nil, err
		}
		coords[i] = Coord{X: x, Y: y}
	}
	return coords, nil
}