// Equals returns true iff pk and other both have the same number of keys, and
// all constituent keys are the same, and in the same order.
328686
func (pk PubKeyMultisigThreshold) Equals(other crypto.PubKey) bool {
	otherKey, sameType := other.(PubKeyMultisigThreshold)
	if !sameType {
		return false
	}
	if pk.K != otherKey.K || len(pk.PubKeys) != len(otherKey.PubKeys) {
		return false
	}
	for i := 0; i < len(pk.PubKeys); i++ {
		if !pk.PubKeys[i].Equals(otherKey.PubKeys[i]) {
			return false
		}
	}
	return true
}
1061571
func (ref ClusterMap) Equals(other ClusterMap) (bool, error) {
	if len(ref) != len(other) {
		return false, fmt.Errorf("ref and other do not contain the same number of clusters (%d and %d)", len(ref), len(other))
	}

	refInv, err := ref.Invert()
	if err != nil {
		return false, fmt.Errorf("ref: %s", err)
	}

	otherInv, err := other.Invert()
	if err != nil {
		return false, fmt.Errorf("other: %s", err)
	}

	clusterIdMap := make(map[int]int)

	// Range through each point index
	for p := range refInv {
		c1 := refInv[p]                // Get the cluster index of this point
		if c2, ok := otherInv[p]; ok { // Check if the other map has this point
			// if so, c2 is the point's cluster in the other map
			if c3, ok := clusterIdMap[c2]; ok { // what's our correspondance with c2?
				if c1 != c3 {
					// if c1 is not what we've currently got, error out
					return false, fmt.Errorf("ref point %d (cluster %d) is assigned to a different cluster (%d) in ref %+v", p, c2, c1, clusterIdMap)
				}
			} else {
				clusterIdMap[c2] = c1
			}
		} else {
			return false, fmt.Errorf("failed to find reference point %d in src", p)
		}
	}

	// Check that after transformation, key contains the same points
	arraysEqual := func(a1, a2 []int) bool {

		cnt := make(map[int]bool)
		for _, a := range a1 {
			cnt[a] = true
		}

		for _, a := range a2 {
			if _, ok := cnt[a]; !ok {
				return false
			}
		}

		return true

	}
	newMap := ClusterMap(make(map[int][]int))
	for cOld := range other {
		cNew := clusterIdMap[cOld]
		if !arraysEqual(ref[cNew], other[cOld]) {
			return false, fmt.Errorf("Re-labelled cluster %d => %d doesn't contain the same points (%d, %d)", cOld, cNew, ref[cNew], other[cOld])
		}
		newMap[cNew] = other[cOld]
	}

	return true, nil

}
278934
func (rsk *ResourceStateKey) Equal(other *ResourceStateKey) bool {
	if rsk == nil || other == nil {
		return false
	}
	if rsk.Mode != other.Mode {
		return false
	}
	if rsk.Type != other.Type {
		return false
	}
	if rsk.Name != other.Name {
		return false
	}
	if rsk.Index != other.Index {
		return false
	}
	return true
}
491429
func (v *NestedListsI32x3) Equals(rhs *NestedListsI32x3) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Integerlist == nil && rhs.Integerlist == nil) || (v.Integerlist != nil && rhs.Integerlist != nil && _List_List_List_I32_Equals(v.Integerlist, rhs.Integerlist))) {
		return false
	}

	return true
}
1307623
func (c Color) Equals(other Color) bool {
	return c.R == other.R &&
		c.G == other.G &&
		c.B == other.B &&
		c.A == other.A
}
1370778
func (ch *Channel) Equals(other *Channel) bool {
	return reflect.DeepEqual(ch, other)
}
1015381
func (cm *ChanMode) Equals(other *ChanMode) bool {
	return reflect.DeepEqual(cm, other)
}
648441
func (bc BoxCorners) Equals(other BoxCorners) bool {
	return bc.TopLeft.Equals(other.TopLeft) &&
		bc.TopRight.Equals(other.TopRight) &&
		bc.BottomRight.Equals(other.BottomRight) &&
		bc.BottomLeft.Equals(other.BottomLeft)
}
1138626
func (s *Store) Equals(other store.Store) bool {
	if other == nil {
		return false
	}
	return s.URL() == other.URL()
}
575344
func (privKey PrivKeySecp256k1) Equals(other crypto.PrivKey) bool {
	if otherSecp, ok := other.(PrivKeySecp256k1); ok {
		return subtle.ConstantTimeCompare(privKey[:], otherSecp[:]) == 1
	}
	return false
}
909138
func (v MergeKeyValue) Equal(o MergeKeyValue) bool {
	if len(v) != len(o) {
		return false
	}

	for key, v1 := range v {
		if v2, found := o[key]; !found || v1 != v2 {
			return false
		}
	}

	return true
}
1271212
func (style Style) Equals(other core.DxfElement) bool {
	if otherStyle, ok := other.(*Style); ok {
		return style.Name == otherStyle.Name &&
			core.FloatEquals(style.Height, otherStyle.Height) &&
			core.FloatEquals(style.Width, otherStyle.Width) &&
			core.FloatEquals(style.Oblique, otherStyle.Oblique) &&
			style.IsBackwards == otherStyle.IsBackwards &&
			style.IsUpsideDown == otherStyle.IsUpsideDown &&
			style.IsShape == otherStyle.IsShape &&
			style.IsVerticalText == otherStyle.IsVerticalText &&
			style.Font == otherStyle.Font &&
			style.BigFont == otherStyle.BigFont
	}
	return false
}
1166215
func (p *scryptParams) Equals(p1 *scryptParams) bool {
	return p.keyLen == p1.keyLen &&
		p.n == p1.n &&
		p.r == p1.r &&
		p.p == p1.p &&
		p.saltLen == p1.saltLen
}
1123141
func (s String) Equals(other DxfElement) bool {
	if sStr, ok := other.(*String); ok {
		return s.value == sStr.value
	}
	return false
}
1238312
func (t Table) Equals(other core.DxfElement) bool {
	if otherTable, ok := other.(Table); ok {
		if len(t) != len(otherTable) {
			return false
		}

		for key, element := range t {
			if otherElement, ok := otherTable[key]; ok {
				if !element.Equals(otherElement) {
					return false
				}
			} else {
				return false
			}

		}
		return true
	}

	return false
}
90108
func (a Line) Equals(other core.DxfElement) bool {
	if otherLine, ok := other.(*Line); ok {
		return a.BaseEntity.Equals(otherLine.BaseEntity) &&
			core.FloatEquals(a.Thickness, otherLine.Thickness) &&
			a.Start.Equals(otherLine.Start) &&
			a.End.Equals(otherLine.End) &&
			a.ExtrusionDirection.Equals(otherLine.ExtrusionDirection)
	}
	return false
}
1310760
func (row *NuagePortTableRow) Equals(otherRow interface{}) bool {

	nuagePortTableRow, ok := otherRow.(NuagePortTableRow)

	if !ok {
		return false
	}

	if strings.Compare(row.Name, nuagePortTableRow.Name) != 0 {
		return false
	}

	if strings.Compare(row.Mac, nuagePortTableRow.Mac) != 0 {
		return false
	}

	if strings.Compare(row.IPAddr, nuagePortTableRow.IPAddr) != 0 {
		return false
	}

	if strings.Compare(row.SubnetMask, nuagePortTableRow.SubnetMask) != 0 {
		return false
	}

	if strings.Compare(row.Gateway, nuagePortTableRow.Gateway) != 0 {
		return false
	}

	if strings.Compare(row.Bridge, nuagePortTableRow.Bridge) != 0 {
		return false
	}

	if strings.Compare(row.Alias, nuagePortTableRow.Alias) != 0 {
		return false
	}

	if strings.Compare(row.NuageDomain, nuagePortTableRow.NuageDomain) != 0 {
		return false
	}

	if strings.Compare(row.NuageNetwork, nuagePortTableRow.NuageNetwork) != 0 {
		return false
	}

	if strings.Compare(row.NuageNetworkType, nuagePortTableRow.NuageNetworkType) != 0 {
		return false
	}

	if strings.Compare(row.NuageZone, nuagePortTableRow.NuageZone) != 0 {
		return false
	}

	if row.EVPNId != nuagePortTableRow.EVPNId {
		return false
	}

	if row.VRFId != nuagePortTableRow.VRFId {
		return false
	}

	if row.VMDomain != nuagePortTableRow.VMDomain {
		return false
	}

	if !reflect.DeepEqual(row.Metadata, nuagePortTableRow.Metadata) {
		return false
	}

	if row.Dirty != nuagePortTableRow.Dirty {
		return false
	}

	return true
}