// PrimaryEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option.
349366
func PrimaryEqual(o1, o2 *PrimaryOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
824157
func (p *PublicKey) IsEqual(otherPubKey *PublicKey) bool {
	return p.X.Cmp(otherPubKey.X) == 0 &&
		p.Y.Cmp(otherPubKey.Y) == 0
}
766486
func (o *TypoToleranceOption) Equal(o2 *TypoToleranceOption) bool {
	if o2 == nil {
		return o.value == typoToleranceTrue
	}
	return o.value == o2.value
}
1163791
func AllEqual(values ...string) bool {
	if len(values) < 2 {
		return true
	}
	compare := values[0]
	for _, v := range values[1:] {
		if v != compare {
			return false
		}
	}
	return true
}
425631
func (s *set) IsEqual(t Interface) bool {
	// Force locking only if given set is threadsafe.
	if conv, ok := t.(*Set); ok {
		conv.l.RLock()
		defer conv.l.RUnlock()
	}

	// return false if they are no the same size
	if sameSize := len(s.m) == t.Size(); !sameSize {
		return false
	}

	equal := true
	t.Each(func(item interface{}) bool {
		_, equal = s.m[item]
		return equal // if false, Each() will end
	})

	return equal
}
266758
func FacetingAfterDistinctEqual(o1, o2 *FacetingAfterDistinctOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
1216069
func ResultsEqual(r1, r2 []Result) bool {
	if len(r1) != len(r2) {
		return false
	}
	for i, r := range r1 {
		if !r.Equal(&r2[i]) {
			return false
		}
	}
	return true
}
931984
func (v Version) LesserEqual(o *Version) bool {
	if o == nil {
		return v.Equals(o)
	}

	if v.Scalar == o.Scalar {
		return v.PID <= o.PID
	}
	return v.Scalar < o.Scalar
}
795925
func (s *ResourceState) Equal(other *ResourceState) bool {
	s.Lock()
	defer s.Unlock()

	if s.Type != other.Type {
		return false
	}

	if s.Provider != other.Provider {
		return false
	}

	// Dependencies must be equal
	sort.Strings(s.Dependencies)
	sort.Strings(other.Dependencies)
	if len(s.Dependencies) != len(other.Dependencies) {
		return false
	}
	for i, d := range s.Dependencies {
		if other.Dependencies[i] != d {
			return false
		}
	}

	// States must be equal
	if !s.Primary.Equal(other.Primary) {
		return false
	}

	return true
}
842816
func (a *ProposalInfo) IsEqual(b *ProposalInfo) bool {
	if a.CensorshipRecord != b.CensorshipRecord || a.Name != b.Name || a.State != b.State ||
		a.NumComments != b.NumComments || a.StatusChangeMsg != b.StatusChangeMsg ||
		a.Status != b.Status || a.Timestamp != b.Timestamp || a.Token != b.Token ||
		a.CensoredDate != b.CensoredDate || a.AbandonedDate != b.AbandonedDate ||
		a.VoteStatus != b.VoteStatus || a.TotalVotes != b.TotalVotes ||
		a.PublishedDate != b.PublishedDate || len(a.VoteResults) != len(b.VoteResults) {
		return false
	}
	return true
}
457292
func (o *ClearExistingRulesOption) Equal(o2 *ClearExistingRulesOption) bool {
	if o2 == nil {
		return o.value == false
	}
	return o.value == o2.value
}
376467
func (t EnumType) Equal(u convert.Equaler) bool {
	other, ok := u.(EnumType)
	if !ok {
		return false
	}
	if !convert.CascadeEqual(t.SimpleType, other.SimpleType) {
		return false
	}
	if !convert.CascadeEqual(t.BaseType, other.BaseType) {
		return false
	}
	if !t.RewritableValues {
		if !reflect.DeepEqual(t.Values, other.Values) {
			return false
		}
	}
	if !reflect.DeepEqual(t.DefaultValue, other.DefaultValue) {
		return false
	}
	return true
}
570732
func SafeEqual(o1, o2 *SafeOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
540272
func FacetFiltersEqual(o1, o2 *FacetFiltersOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
524618
func OptionalFiltersEqual(o1, o2 *OptionalFiltersOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
237873
func PageEqual(o1, o2 *PageOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
961502
func (o *ReplaceSynonymsInHighlightOption) Equal(o2 *ReplaceSynonymsInHighlightOption) bool {
	if o2 == nil {
		return o.value == true
	}
	return o.value == o2.value
}