// CopyRulesSlice copies input slice of Rules and returns the copy
431223
func CopyRulesSlice(in []Rule) []Rule {
	out := make([]Rule, len(in))
	copy(out, in)
	return out
}
586420
func goSliceRawSlice(s string) []string {
	s = strings.TrimPrefix(s, "[")
	s = strings.TrimSuffix(s, "]")
	s = strings.TrimSpace(s)
	if s == "" {
		return nil
	}
	a := strings.Split(s, " ")
	return a
}
13052
func (in SortableRuleSlice) DeepCopy() SortableRuleSlice {
	if in == nil {
		return nil
	}
	out := new(SortableRuleSlice)
	in.DeepCopyInto(out)
	return *out
}
43891
func StringSlice(name string, out *[]string, predicates ...Predicate) Param {
	return func(r *http.Request) error {
		for _, p := range predicates {
			if err := p.Pass(name, r); err != nil {
				return err
			}
		}
		*out = make([]string, len(r.Form[name]))
		copy(*out, r.Form[name])
		return nil
	}
}
979554
func NewSlice(data *C.char, size C.size_t) *Slice {
	return &Slice{data, size, false}
}
486109
func decodeSlice(elemType reflect.Type, slice reflect.Value, input map[string]interface{}) error {
	var v reflect.Value
	if elemType.Kind() == reflect.Ptr {
		v = reflect.New(elemType.Elem())
	} else {
		v = reflect.New(elemType)
	}

	if !v.CanInterface() {
		return fmt.Errorf("can't interface %#v", v)
	}

	if err := decodeMap(input, v.Interface()); err != nil {
		return err
	}

	if elemType.Kind() == reflect.Struct {
		v = v.Elem()
	}
	slice.Set(reflect.Append(slice, v))

	return nil
}
235094
func (dt *DbfTable) convertToByteSlice(value string, numberOfBytes int) []byte {
	b := []byte(value)
	if len(b) <= numberOfBytes {
		return b
	}
	return b[0:numberOfBytes]
}
702306
func (s StringSlice) StringSlice() []string {
	ss := []string{}
	for _, tmp := range s {
		if len(tmp) <= 2 {
			continue
		}
		ss = append(ss, tmp)
	}
	return ss
}
227673
func InSlice(value, slice interface{}) bool {
	switch reflect.TypeOf(slice).Kind() {
	case reflect.Slice, reflect.Ptr:
		values := reflect.Indirect(reflect.ValueOf(slice))
		if values.Len() == 0 {
			return false
		}

		val := reflect.Indirect(reflect.ValueOf(value))

		if val.Kind() != values.Index(0).Kind() {
			return false
		}

		for i := 0; i < values.Len(); i++ {
			if reflect.DeepEqual(values.Index(i).Interface(), val.Interface()) {
				return true
			}
		}
	}
	return false
}
483201
func setSlice(dst, src reflect.Value) error {
	slice := reflect.MakeSlice(dst.Type(), src.Len(), src.Len())
	for i := 0; i < src.Len(); i++ {
		v := src.Index(i)
		reflect.Copy(slice.Index(i), v)
	}

	dst.Set(slice)
	return nil
}
40491
func (v ByteView) ByteSlice() []byte {
	if v.b != nil {
		return cloneBytes(v.b)
	}
	return []byte(v.s)
}
1261803
func FileSlice(name string, files *Files, predicates ...Predicate) Param {
	return func(r *http.Request) error {
		err := r.ParseMultipartForm(maxMemoryBytes)
		if err != nil {
			return err
		}
		if r.MultipartForm == nil && r.MultipartForm.File == nil {
			return fmt.Errorf("missing form")
		}
		for _, p := range predicates {
			if err := p.Pass(name, r); err != nil {
				return err
			}
		}

		fhs := r.MultipartForm.File[name]
		if len(fhs) == 0 {
			*files = []*FileWrapper{}
			return nil
		}

		*files = make([]*FileWrapper, len(fhs))
		for i, fh := range fhs {
			f, err := fh.Open()
			if err != nil {
				files.Close()
				return err
			}
			(*files)[i] = &FileWrapper{f, fh.Filename}
		}
		return nil
	}
}
220968
func (roles Roles) StringSlice() []string {
	s := make([]string, 0)
	for _, r := range roles {
		s = append(s, r.String())
	}
	return s
}
1114044
func (r *Response) PageSlice() []Page {
	pl := []Page{}
	for _, page := range r.Query.Pages {
		pl = append(pl, page)
	}
	return pl
}
274362
func ReadSlice(rd io.Reader) (s Slice, err error) {
	// Just in case of programming mistake. Not intentionally used.
	defer func() {
		if r := recover(); r != nil {
			err = errors.New(fmt.Sprint(r))
		}
	}()

	return decodeSlice(rd, "", true)
}
1334572
func Uint64ValueSlice(src []*uint64) []uint64 {
	dst := make([]uint64, len(src))
	for i := 0; i < len(src); i++ {
		if src[i] != nil {
			dst[i] = *(src[i])
		}
	}
	return dst
}
346772
func BoolSlice(src []bool) []*bool {
	dst := make([]*bool, len(src))
	for i := 0; i < len(src); i++ {
		dst[i] = &(src[i])
	}
	return dst
}