// FilterInt iterates over a collection of int, returning an array of
// all int elements predicate returns truthy for.
332759
func FilterInt(s []int, cb func(s int) bool) []int {
	results := []int{}

	for _, i := range s {
		result := cb(i)

		if result {
			results = append(results, i)
		}
	}

	return results
}
242656
func FilterEntries(f Filter) int {
	// Compact the list
	dst := 0
	src := 0
	n := f.Len()
	for dst < n {
		for src < n && f.Filter(src) {
			src++
		}
		if src == n {
			break
		}
		end := src + 1
		for end < n && !f.Filter(end) {
			end++
		}
		span := end - src
		if span > 0 {
			f.Move(dst, src, span)
			dst += span
			src += span
		}
	}

	// Return the size of the slice
	return dst
}
136317
func (r Result) Filter(fn func(*resource.Info) bool) Result {
	var result Result
	for _, i := range r {
		if fn(i) {
			result.Append(i)
		}
	}
	return result
}
1072135
func (entries IndexMetadataSlice) filter(match func(*IndexMetadata) bool) IndexMetadataSlice {
	result := IndexMetadataSlice{}
	for _, metadata := range entries {
		if match(metadata) {
			result = append(result, metadata)
		}
	}
	return result
}
740085
func (api *SIMAPI) FilterBy(key string, value interface{}) *SIMAPI {
	api.filterBy(key, value, false)
	return api
}
978258
func listFilterIfs(filter func(netlink.Link) int) (map[int]netlink.Link, error) {
	ifs, err := netlink.LinkList()
	if err != nil {
		return nil, err
	}
	vethLXCIdxs := map[int]netlink.Link{}
	for _, intf := range ifs {
		if idx := filter(intf); idx != -1 {
			vethLXCIdxs[idx] = intf
		}
	}
	return vethLXCIdxs, nil
}
1171059
func DefaultInt(obj interface{}, defaultValue int) int {
	return int(DefaultInt64(obj, int64(defaultValue)))
}
657983
func FilterInPlace(sl interface{}, f interface{}) {
	v := reflect.ValueOf(sl).Elem()
	j := 0
	for i := 0; i < v.Len(); i++ {
		e := v.Index(i)
		if reflect.ValueOf(f).Call([]reflect.Value{e.Addr()})[0].Bool() {
			v.Index(j).Set(e)
			j++
		}
	}
	v.SetLen(j)
}
64202
func (c *SQLiteContext) ResultInt(i int) {
	if i64 && (i > math.MaxInt32 || i < math.MinInt32) {
		C.sqlite3_result_int64((*C.sqlite3_context)(c), C.sqlite3_int64(i))
	} else {
		C.sqlite3_result_int((*C.sqlite3_context)(c), C.int(i))
	}
}
589496
func Filter(src string, filter func(int, []byte) error) error {
	return Read(src, func(fd *os.File) (err error) {
		return io2.FilterRead(fd, filter)
	})
}
458625
func (g *expansionGenerator) Filter(c *generator.Context, t *types.Type) bool {
	return t == g.types[0]
}
805106
func (c *Context) Int(name string) int {
	return lookupInt(name, c.flagSet)
}
37547
func (r *MockResult) Int(i int) int {
	if r.Contains(i) {
		return r.Result[i].(int)
	} else {
		return 0
	}
}
759843
func (fsm *MapInputSource) Int(name string) (int, error) {
	otherGenericValue, exists := fsm.valueMap[name]
	if exists {
		otherValue, isType := otherGenericValue.(int)
		if !isType {
			return 0, incorrectTypeForFlagError(name, "int", otherGenericValue)
		}
		return otherValue, nil
	}
	nestedGenericValue, exists := nestedVal(name, fsm.valueMap)
	if exists {
		otherValue, isType := nestedGenericValue.(int)
		if !isType {
			return 0, incorrectTypeForFlagError(name, "int", nestedGenericValue)
		}
		return otherValue, nil
	}

	return 0, nil
}
1225305
func (enc *Encoder) SliceInt(s []int) {
	enc.Array(EncodeArrayFunc(func(enc *Encoder) {
		for _, i := range s {
			enc.Int(i)
		}
	}))
}
109931
func (e *entry) filter(min, max int64) {
	e.mu.Lock()
	if len(e.values) > 1 {
		e.values = e.values.Deduplicate()
	}
	e.values = e.values.Exclude(min, max)
	e.mu.Unlock()
}
635558
func (s *IndicesAnalyzeService) Filter(filter ...string) *IndicesAnalyzeService {
	s.request.Filter = filter
	return s
}