// Combine returns a region covering both regions, dir is same as r
496128
func (r Region) Combine(r2 Region) Region {
	return Region{Min(r.From, r2.From), Max(r.To, r2.To), r.Dir}
}
587141
func (res *ExecResult) Combined() string {
	return res.outBuffer.String() + res.errBuffer.String()
}
1229721
func (filters identityFilters) combine() identityFilter {
	return func(identity api.PeerIdentityType) bool {
		for _, f := range filters {
			if !f(identity) {
				return false
			}
		}
		return true
	}
}
1356605
func (c *Context) Merge(data Data) Data {
	if data == nil {
		return dupeMaps(c.data)
	} else {
		return dupeMaps(c.data, data)
	}
}
1082734
func Combine(a, b AABB) AABB {
	return AABB{
		vect.Min(a.Lower, b.Lower),
		vect.Max(a.Upper, b.Upper),
	}
}
655593
func (a *SentinelConfig) Merge(b *SentinelConfig) *SentinelConfig {
	result := *a
	if len(b.Imports) > 0 {
		result.Imports = append(result.Imports, b.Imports...)
	}
	return &result
}
82261
func CombineErrors(delimiter string, errs ...error) error {
	var formatStrs = []string{}

	for _, e := range errs {
		if e == nil {
			continue
		}
		formatStrs = append(formatStrs, e.Error())
	}

	return fmt.Errorf(strings.Join(formatStrs, delimiter))
}
1004199
func merge(maps ...map[string]string) map[string]string {
	var output map[string]string = nil
	for _, m := range maps {
		if m != nil && output == nil {
			output = map[string]string{}
		}
		for k, v := range m {
			output[k] = v
		}
	}
	return output
}
462423
func (c *TasksConfig) Combine(configs ...TasksConfig) {
	if c.DefaultTasks.Tasks == nil {
		c.DefaultTasks.Tasks = make(map[string]v0.SingleDefaultTaskConfig)
	}

	var pluginsFromConfigs []v0.SinglePluginConfig
	for _, cfg := range configs {
		// DefaultTask resolvers are appended and uniquified
		c.DefaultTasks.DefaultResolvers = pluginsinternal.Uniquify(append(c.DefaultTasks.DefaultResolvers, cfg.DefaultTasks.DefaultResolvers...))

		// DefaultTask tasks key/values are simply copied (and overwritten with last writer wins for any duplicate keys)
		for k, v := range cfg.DefaultTasks.Tasks {
			c.DefaultTasks.Tasks[k] = v
		}

		// Plugin resolvers are appended and uniquified
		c.Plugins.DefaultResolvers = pluginsinternal.Uniquify(append(c.Plugins.DefaultResolvers, cfg.Plugins.DefaultResolvers...))

		// Append provided plugins to "pluginsFromConfigs" list
		pluginsFromConfigs = append(pluginsFromConfigs, cfg.Plugins.Plugins...)
	}

	// determine all of the provided plugins that specify overrides
	pluginsFromConfigsWithOverride := matchingPluginConfigs(pluginsFromConfigs, func(in v0.SinglePluginConfig) bool { return in.Override })

	// remove any of the original plugins that match override locators (because they will be overridden)
	var originalConfigsWithoutOverridenPlugins []v0.SinglePluginConfig
	for _, originalCfg := range c.Plugins.Plugins {
		locatorCfg := LocatorConfig(originalCfg.Locator)
		if locatorParam, err := locatorCfg.ToParam(); err == nil {
			// if locator can be parsed and matches a plugin for which an override was specified, omit it (it will be overridden)
			if _, ok := pluginsFromConfigsWithOverride[locatorParam.GroupAndProductString()]; ok {
				continue
			}
		}
		// plugin was not overridden or locator could not be parsed: keep it
		originalConfigsWithoutOverridenPlugins = append(originalConfigsWithoutOverridenPlugins, originalCfg)
	}

	// update plugins list. Any of the original plugins that match an override from an input plugin will be removed.
	// Note that no deduplication/override processing is done for the provided configurations -- if the input
	// configurations specifies duplicate plugins, that will be handled later when determining plugin compatibility.
	c.Plugins.Plugins = append(originalConfigsWithoutOverridenPlugins, pluginsFromConfigs...)
}
461360
func Merge(mapA map[string]interface{}, mapB map[string]interface{}) map[string]interface{} {
	for k, v := range mapA {
		mapB[k] = v
	}

	return mapB
}
652929
func (api *RegionAPI) Include(key string) *RegionAPI {
	api.include(key)
	return api
}
987420
func (h *Histo) Merge(v *metricpb.HistogramValue) {
	if v.TDigest != nil {
		h.Value.Merge(tdigest.NewMergingFromData(v.TDigest))
	}
}
1063311
func combineEndpointErrors(allErrors map[string]error) error {
	var parts []string
	for ep, err := range allErrors {
		parts = append(parts, fmt.Sprintf("%s: %s", ep, err))
	}
	return errors.New(strings.Join(parts, ", "))
}
152626
func (ini *INI) Merge(from *INI, override bool) {
	for section, kv := range from.sections {
		for key, value := range kv {
			_, found := ini.SectionGet(section, key)
			if override || !found {
				ini.SectionSet(section, key, value)
			}
		}
	}
}
570662
func (h *Histogram) Merge(from *Histogram) (dropped int64) {
	i := from.rIterator()
	for i.next() {
		v := i.valueFromIdx
		c := i.countAtIdx

		if h.RecordValues(v, c) != nil {
			dropped += c
		}
	}

	return
}
271218
func CombineFields(s []Field) string {
	r := make([]string, len(s))
	for i, v := range s {
		r[i] = string(v)
	}
	return strings.Join(r, ",")
}
1257851
func CombineFlags(flags ...Flags) Flags {
	returnFlags := Flags(0)
	for _, f := range flags {
		returnFlags |= f
	}
	return returnFlags
}