// ToSlice - returns TargetID slice from TargetIDSet.
192502
func (set TargetIDSet) ToSlice() []TargetID {
	keys := make([]TargetID, 0, len(set))
	for k := range set {
		keys = append(keys, k)
	}
	return keys
}
483363
func intSliceDiff(x, y []int) []int {
	var out []int

	for _, cX := range x {
		found := false
		for _, cY := range y {
			if cX == cY {
				found = true
				break
			}
		}
		if !found {
			out = append(out, cX)
		}
	}

	for _, cY := range y {
		found := false
		for _, cX := range x {
			if cY == cX {
				found = true
				break
			}
		}
		if !found {
			out = append(out, cY)
		}
	}

	return out
}
913643
func (s Int8Slice) Less(i, j int) bool {
	return s[i] < s[j]
}
795665
func (set KeySet) ToSlice() []Key {
	keys := []Key{}

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

	return keys
}
344646
func (mmap MarshalMap) Int64Slice(key string) ([]int64, error) {
	return mmap.Int64Array(key)
}
368541
func copySlice(slice []byte) []byte {
	ret := make([]byte, len(slice))
	copy(ret, slice)
	return ret
}
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
}
420681
func IntSlice(value []int, name, usage string) *[]int {
	p := new([]int)
	flag.Var(NewIntSlice(value, p), name, usage)
	return p
}
901278
func ToInt64Slice(i interface{}, d ...[]int64) (r []int64) {
	v, err := TryToInt64Slice(i)
	if err != nil && len(d) > 0 {
		return d[0]
	}
	return v
}
724832
func ToStringSliceE(i interface{}) ([]string, error) {
	var a []string

	switch v := i.(type) {
	case []interface{}:
		for _, u := range v {
			a = append(a, ToString(u))
		}
		return a, nil
	case []string:
		return v, nil
	case string:
		return strings.Fields(v), nil
	case interface{}:
		str, err := ToStringE(v)
		if err != nil {
			return a, fmt.Errorf("unable to cast %#v of type %T to []string", i, i)
		}
		return []string{str}, nil
	default:
		return a, fmt.Errorf("unable to cast %#v of type %T to []string", i, i)
	}
}
971367
func TryToInt64Slice(i interface{}) (r []int64, err error) {
	switch v := i.(type) {
	case []int:
		r = make([]int64, len(v))
		for index, value := range v {
			r[index] = int64(value)
		}
	case []int32:
		r = make([]int64, len(v))
		for index, value := range v {
			r[index] = int64(value)
		}
	case []int64:
		r = v
	case *[]int64:
		r = *v
	case []string:
		r = make([]int64, len(v))
		for index, value := range v {
			r[index], err = TryToInt64(value)
			if err != nil {
				return
			}
		}
	default:
		err = castError(i, "[]int64")
	}
	return
}
597933
func InStringSlice(sl []string, val string) bool {
	for _, s := range sl {
		if s == val {
			return true
		}
	}

	return false
}
383514
func addressableSlice(slice interface{}) reflect.Value {
	v := reflect.ValueOf(slice)
	p := reflect.New(v.Type())
	p.Elem().Set(v)
	return p.Elem()
}
820585
func (fsm *MapInputSource) IntSlice(name string) ([]int, error) {
	otherGenericValue, exists := fsm.valueMap[name]
	if !exists {
		otherGenericValue, exists = nestedVal(name, fsm.valueMap)
		if !exists {
			return nil, nil
		}
	}

	otherValue, isType := otherGenericValue.([]interface{})
	if !isType {
		return nil, incorrectTypeForFlagError(name, "[]interface{}", otherGenericValue)
	}

	var intSlice = make([]int, 0, len(otherValue))
	for i, v := range otherValue {
		intValue, isType := v.(int)

		if !isType {
			return nil, incorrectTypeForFlagError(fmt.Sprintf("%s[%d]", name, i), "int", v)
		}

		intSlice = append(intSlice, intValue)
	}

	return intSlice, nil
}
1217095
func NewStringSlice(val []string, p *[]string) *StringSliceValue {
	*p = val
	return (*StringSliceValue)(p)
}
803043
func DirSlice(t *testing.T, path string) []Case {
	sl := []Case{}
	for c := range Dir(t, path) {
		sl = append(sl, c)
	}
	return sl
}
267770
func (d PixSlice) Slice(newSliceType reflect.Type) interface{} {
	sv := reflect.ValueOf(d)
	newSlice := reflect.New(newSliceType)
	hdr := (*reflect.SliceHeader)(unsafe.Pointer(newSlice.Pointer()))
	hdr.Cap = sv.Cap() * int(sv.Type().Elem().Size()) / int(newSliceType.Elem().Size())
	hdr.Len = sv.Len() * int(sv.Type().Elem().Size()) / int(newSliceType.Elem().Size())
	hdr.Data = uintptr(sv.Pointer())
	return newSlice.Elem().Interface()
}