// FilterOutInPlace do the filtering out in place.
// The remained are the ones who doesn't match the filter, storing in the original slice.
// The filteredOut are the ones match the filter, storing in a new slice.
16045
func FilterOutInPlace(input []Expression, filter func(Expression) bool) (remained, filteredOut []Expression) {
	for i := len(input) - 1; i >= 0; i-- {
		if filter(input[i]) {
			filteredOut = append(filteredOut, input[i])
			input = append(input[:i], input[i+1:]...)
		}
	}
	return input, filteredOut
}
436157
func (s strings) Filter(in []string, keep func(item string) bool) []string {
	var out []string
	for _, item := range in {
		if keep(item) {
			out = append(out, item)
		}
	}

	return out
}
42611
func (f *BloomFilter) location(h [4]uint64, i uint) uint {
	return uint(location(h, i) % uint64(f.m))
}
843316
func (t *TaskEnv) ParseAndReplace(args []string) []string {
	if args == nil {
		return nil
	}

	replaced := make([]string, len(args))
	for i, arg := range args {
		replaced[i] = hargs.ReplaceEnv(arg, t.EnvMap, t.NodeAttrs)
	}

	return replaced
}
814381
func FilterBridgeAddresses(addresses []Address) []Address {
	addressesToRemove := make(map[string][]net.Addr)
	gatherLXCAddresses(addressesToRemove)
	gatherBridgeAddresses(DefaultLXDBridge, addressesToRemove)
	gatherBridgeAddresses(DefaultKVMBridge, addressesToRemove)
	filtered := filterAddrs(addresses, addressesToRemove)
	logger.Debugf("addresses after filtering: %v", filtered)
	return filtered
}
919857
func filterOverlap(a, b []Filter) bool {
	for ia := range a {
		for ib := range b {
			if a[ia].Field != b[ib].Field {
				continue
			}
			if a[ia].CompOp != b[ib].CompOp || a[ia].Value != b[ib].Value {
				return false
			} else {
				break
			}
		}
	}
	return true
}
920149
func (fs *Filters) removeFromTopicMatchers(watcher *Filter) {
	delete(fs.allTopicsMatcher, watcher)
	for _, topic := range watcher.Topics {
		delete(fs.topicMatcher[BytesToTopic(topic)], watcher)
	}
}
55441
func (a *AliasAddAction) Filter(filter Query) *AliasAddAction {
	a.filter = filter
	return a
}
358189
func (api *VPCRouterAPI) FilterBy(key string, value interface{}) *VPCRouterAPI {
	api.filterBy(key, value, false)
	return api
}
681104
func WithFilter(f ...Filter) SelectOption {
	return func(o *SelectOptions) {
		o.Filters = append(o.Filters, f...)
	}
}
1058473
func (s *SeriesIDSet) MergeInPlace(other *SeriesIDSet) {
	if s == other {
		return
	}

	other.RLock()
	s.Lock()
	s.bitmap.Or(other.bitmap)
	s.Unlock()
	other.RUnlock()
}
1287548
func (p *TodoQueryProperty) Filter(op string, value interface{}) *TodoQueryBuilder {
	switch op {
	case "<=":
		p.LessThanOrEqual(value)
	case ">=":
		p.GreaterThanOrEqual(value)
	case "<":
		p.LessThan(value)
	case ">":
		p.GreaterThan(value)
	case "=":
		p.Equal(value)
	default:
		p.bldr.q = p.bldr.q.Filter(p.name+" "+op, value) // error raised by native query
	}
	if p.bldr.plugin != nil {
		p.bldr.plugin.Filter(p.name, op, value)
	}
	return p.bldr
}
1168571
func (s *Selection) Filter(selector string) *Selection {
	return s.FilterMatcher(compileMatcher(selector))
}
1131205
func (api *GSLBAPI) FilterBy(key string, value interface{}) *GSLBAPI {
	api.filterBy(key, value, false)
	return api
}
241443
func (o *FilterOptions) Include(d *manifestlist.ManifestDescriptor, hasMultiple bool) bool {
	if o.OSFilter == nil {
		return true
	}
	if o.DefaultOSFilter && !hasMultiple {
		return true
	}
	s := PlatformSpecString(d.Platform)
	return o.OSFilter.MatchString(s)
}
1373562
func (self *StandardFilterer) AddFilter(filter Filter) {
	if !self.filters.SetContains(filter) {
		self.filters.SetAdd(filter)
	}
}
1081019
func (c *Container) unionInPlace(other *Container) {
	switch c.typ {
	case containerBitmap:
		switch other.typ {
		case containerBitmap:
			unionBitmapBitmapInPlace(c, other)
		case containerArray:
			unionBitmapArrayInPlace(c, other)
		case containerRun:
			unionBitmapRunInPlace(c, other)

		}
	case containerArray:
		switch other.typ {
		case containerBitmap:
			c.arrayToBitmap()
			unionBitmapBitmapInPlace(c, other)
		case containerArray:
			unionArrayArrayInPlace(c, other)
		case containerRun:
			c.arrayToBitmap()
			unionBitmapRunInPlace(c, other)
		}
	case containerRun:
		switch other.typ {
		case containerBitmap:
			c.runToBitmap()
			unionBitmapBitmapInPlace(c, other)
		case containerArray:
			c.runToBitmap()
			unionBitmapArrayInPlace(c, other)
		case containerRun:
			c.runToBitmap()
			unionBitmapRunInPlace(c, other)
		}
	}
}