// SymmetricDifference returns the elements that are not present in both sets.
355346
func (s *OrderedSet) SymmetricDifference(other *OrderedSet) *OrderedSet {
	left := s.Difference(other)
	right := other.Difference(s)

	return left.Union(right)
}
1139713
func (b *BitSet) DifferenceCardinality(compare *BitSet) uint {
	panicIfNull(b)
	panicIfNull(compare)
	l := int(compare.wordCount())
	if l > int(b.wordCount()) {
		l = int(b.wordCount())
	}
	cnt := uint64(0)
	cnt += popcntMaskSlice(b.set[:l], compare.set[:l])
	cnt += popcntSlice(b.set[l:])
	return uint(cnt)
}
433835
func deInterface(v reflect.Value) reflect.Value {
	if v.Kind() == reflect.Interface && !v.IsNil() {
		v = v.Elem()
	}
	return v
}
943343
func diffLists(original, modified []interface{}, t reflect.Type, mergeKey string, ignoreChangesAndAdditions, ignoreDeletions bool) ([]interface{}, error) {
	if len(original) == 0 {
		if len(modified) == 0 || ignoreChangesAndAdditions {
			return nil, nil
		}

		return modified, nil
	}

	elementType, err := sliceElementType(original, modified)
	if err != nil {
		return nil, err
	}

	var patch []interface{}

	if elementType.Kind() == reflect.Map {
		patch, err = diffListsOfMaps(original, modified, t, mergeKey, ignoreChangesAndAdditions, ignoreDeletions)
	} else if !ignoreChangesAndAdditions {
		patch, err = diffListsOfScalars(original, modified)
	}

	if err != nil {
		return nil, err
	}

	return patch, nil
}
979847
func (set LiteralFieldSet) SymmetricDifference(other LiteralFieldSet) LiteralFieldSet {
	aDiff := set.Difference(other)
	bDiff := other.Difference(set)
	return aDiff.Union(bDiff)
}
888849
func (gdw *NaiveDiffDriver) DiffSize(id string, idMappings *idtools.IDMappings, parent string, parentMappings *idtools.IDMappings, mountLabel string) (size int64, err error) {
	driver := gdw.ProtoDriver

	if idMappings == nil {
		idMappings = &idtools.IDMappings{}
	}
	if parentMappings == nil {
		parentMappings = &idtools.IDMappings{}
	}

	changes, err := gdw.Changes(id, idMappings, parent, parentMappings, mountLabel)
	if err != nil {
		return
	}

	options := MountOpts{
		MountLabel: mountLabel,
	}
	layerFs, err := driver.Get(id, options)
	if err != nil {
		return
	}
	defer driver.Put(id)

	return archive.ChangesSize(layerFs, changes), nil
}
296004
func suppressAwsDbEngineVersionDiffs(k, old, new string, d *schema.ResourceData) bool {
	// First check if the old/new values are nil.
	// If both are nil, we have no state to compare the values with, so register a diff.
	// This populates the attribute field during a plan/apply with fresh state, allowing
	// the attribute to still be used in future resources.
	// See https://github.com/hashicorp/terraform/issues/11881
	if old == "" && new == "" {
		return false
	}

	if v, ok := d.GetOk("auto_minor_version_upgrade"); ok {
		if v.(bool) {
			// If we're set to auto upgrade minor versions
			// ignore a minor version diff between versions
			if strings.HasPrefix(old, new) {
				log.Printf("[DEBUG] Ignoring minor version diff")
				return true
			}
		}
	}

	// Throw a diff by default
	return false
}
51893
func DiffPermissionsToArray(leftName string, left *tabletmanagerdatapb.Permissions, rightName string, right *tabletmanagerdatapb.Permissions) (result []string) {
	er := concurrency.AllErrorRecorder{}
	DiffPermissions(leftName, left, rightName, right, &er)
	if er.HasErrors() {
		return er.ErrorStrings()
	}
	return nil
}
1103035
func (c *ConfigDataNode) ReverseMerge(n ctree.Node) *ConfigDataNode {
	cd := n.(*ConfigDataNode)
	copy := NewNode()
	t2 := c.table
	for k, v := range cd.Table() {
		copy.table[k] = v
	}
	for k, v := range t2 {
		copy.table[k] = v
	}
	return copy
}
1267749
func diffAllocs(existing map[string]uint64, allocs *allocUpdates) *diffResult {
	// Scan the existing allocations
	result := &diffResult{}
	for existID, existIndex := range existing {
		// Check if the alloc was updated or filtered because an update wasn't
		// needed.
		alloc, pulled := allocs.pulled[existID]
		_, filtered := allocs.filtered[existID]

		// If not updated or filtered, removed
		if !pulled && !filtered {
			result.removed = append(result.removed, existID)
			continue
		}

		// Check for an update
		if pulled && alloc.AllocModifyIndex > existIndex {
			result.updated = append(result.updated, alloc)
			continue
		}

		// Ignore this
		result.ignore = append(result.ignore, existID)
	}

	// Scan the updated allocations for any that are new
	for id, pulled := range allocs.pulled {
		if _, ok := existing[id]; !ok {
			result.added = append(result.added, pulled)
		}
	}
	return result
}
625414
func (d *Driver) CounterClockwise(val int) error {
	d.cmdMutex.Lock()
	defer d.cmdMutex.Unlock()

	d.lx = float32(val) / 100.0 * -1
	return nil
}
1207617
func (b *BitSet) InPlaceDifference(compare *BitSet) {
	panicIfNull(b)
	panicIfNull(compare)
	l := int(compare.wordCount())
	if l > int(b.wordCount()) {
		l = int(b.wordCount())
	}
	for i := 0; i < l; i++ {
		b.set[i] &^= compare.set[i]
	}
}
469225
func (d *Driver) DiffSize(id, parent string) (size int64, err error) {
	return directory.Size(path.Join(virtPath, id))
}
81272
func (q1 Quat) OrientationEqualThreshold(q2 Quat, epsilon float32) bool {
	return Abs(q1.Normalize().Dot(q2.Normalize())) > 1-epsilon
}
347924
func SymmetricDifference(s Interface, t Interface) Interface {
	u := Difference(s, t)
	v := Difference(t, s)
	return Union(u, v)
}
1189472
func (c C) Div(val Input) Input {
	if v, ok := val.(C); ok {
		return C(c / v)
	}
	return val.Reciprocal().Mul(c)
}
1245439
func (v delegatingStrategy) MergePrimitive(diff apply.PrimitiveElement) (apply.Result, error) {
	// Always replace primitives
	return v.replace.MergePrimitive(diff)
}