// InStringSlice check if the `src` string in the slice
498806
func InStringSlice(slice []string, src string) bool {
	for _, s := range slice {
		if s == src {
			return true
		}
	}

	return false
}
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)
	}
}
24721
func unionStringSlice(a, b []string) []string {
	// Sort both sets first.
	sort.Strings(a)
	sort.Strings(b)

	// Find size of largest slice.
	n := len(a)
	if len(b) > n {
		n = len(b)
	}

	// Exit if both sets are empty.
	if n == 0 {
		return nil
	}

	// Iterate over both in order and merge.
	other := make([]string, 0, n)
	for len(a) > 0 || len(b) > 0 {
		if len(a) == 0 {
			other, b = append(other, b[0]), b[1:]
		} else if len(b) == 0 {
			other, a = append(other, a[0]), a[1:]
		} else if a[0] < b[0] {
			other, a = append(other, a[0]), a[1:]
		} else if b[0] < a[0] {
			other, b = append(other, b[0]), b[1:]
		} else {
			other, a, b = append(other, a[0]), a[1:], b[1:]
		}
	}
	return other
}
254035
func appendSlice(slice, data []byte) []byte {
	slice = append(slice, data...)
	return slice
}
521639
func (t *SQLStringSlice) ToStringSlice() *[]string {
	if t == nil {
		return nil
	}
	data := []string(*t)
	return &data
}
1189422
func ByteSliceToUint64Slice(in []byte) ([]uint64, error) {
	buffer := bytes.NewBuffer(in)

	out := make([]uint64, len(in)/8)
	err := binary.Read(buffer, STORE_ENDIAN, &out)
	if err != nil {
		return nil, err
	}
	return out, nil
}
794274
func IntSlice(src []int) []*int {
	dst := make([]*int, len(src))
	for i := 0; i < len(src); i++ {
		dst[i] = &(src[i])
	}
	return dst
}
365179
func Uint32Slice(src []uint32) []*uint32 {
	dst := make([]*uint32, len(src))
	for i := 0; i < len(src); i++ {
		dst[i] = &(src[i])
	}
	return dst
}
443066
func isStringInSlice(s []string, what string) bool {
	for i := range s {
		if s[i] == what {
			return true
		}
	}
	return false
}
744657
func StringToIntSlice(s, sep string) []int {
	if s == "" {
		return nil
	}

	fields := strings.Split(s, sep)
	slice := make([]int, len(fields))
	for i, f := range fields {
		slice[i] = ToInt(f)
	}
	return slice
}
995756
func (c *Context) GetStringSlice(key string) (ss []string) {
	if val, ok := c.Get(key); ok && val != nil {
		ss, _ = val.([]string)
	}
	return
}
1161999
func (c *MemoryStore) AppendSlice(key string, values ...interface{}) error {
	items, err := c.GetSlice(key)
	if err != nil {
		return err
	}

	if items == nil {
		return c.SetSlice(key, values)
	}

	for _, item := range values {
		items = append(items, item)
	}

	return c.cache.Replace(key, items, c.expiration)
}
1007462
func (p pointer) appendInt32Slice(v int32) {
	s := (*[]int32)(p.p)
	*s = append(*s, v)
}
1053407
func copyslice(input Float64Data) Float64Data {
	s := make(Float64Data, input.Len())
	copy(s, input)
	return s
}
394743
func (t *Tags) MergeFromStringSlice(slice []string) error {
	for _, s := range slice {
		err := t.Add(s)
		if err != nil && !e.Equal(err, ErrTagExist) {
			return e.Forward(err)
		}
	}
	return nil
}
368541
func copySlice(slice []byte) []byte {
	ret := make([]byte, len(slice))
	copy(ret, slice)
	return ret
}
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
}