// Equal returns true if the given option is equal to the instance one. In case
// the given option is nil, we checked the instance one is set to the default
// value of the option.
490350
func (o *HighlightPreTagOption) Equal(o2 *HighlightPreTagOption) bool {
	if o2 == nil {
		return o.value == "<em>"
	}
	return o.value == o2.value
}
478779
func (o *PaginationLimitedToOption) Equal(o2 *PaginationLimitedToOption) bool {
	if o2 == nil {
		return o.value == 1000
	}
	return o.value == o2.value
}
1128336
func Equal(l, r interface{}) bool {
	if l == nil || r == nil {
		return false
	}
	switch val := l.(type) {
	case *Error:
		return val.Equal(r)
	case error:
		return newError(val, 2).(*Error).Equal(r)
	default:
		panic("invalid type, must be *Error")
	}
}
96756
func (a *AttributeTypeAndValue) Equal(other *AttributeTypeAndValue) bool {
	return strings.EqualFold(a.Type, other.Type) && a.Value == other.Value
}
1160840
func (o *AllowCompressionOfIntegerArrayOption) Equal(o2 *AllowCompressionOfIntegerArrayOption) bool {
	if o2 == nil {
		return o.value == false
	}
	return o.value == o2.value
}
145552
func (v Var) Equal(other Value) bool {
	switch other := other.(type) {
	case Var:
		return v == other
	default:
		return false
	}
}
933636
func (o *HitsPerPageOption) Equal(o2 *HitsPerPageOption) bool {
	if o2 == nil {
		return o.value == 20
	}
	return o.value == o2.value
}
758733
func (o *ExactOnSingleWordQueryOption) Equal(o2 *ExactOnSingleWordQueryOption) bool {
	if o2 == nil {
		return o.value == "attribute"
	}
	return o.value == o2.value
}
31507
func (o *QueryTypeOption) Equal(o2 *QueryTypeOption) bool {
	if o2 == nil {
		return o.value == "prefixLast"
	}
	return o.value == o2.value
}
770456
func (o *RemoveWordsIfNoResultsOption) Equal(o2 *RemoveWordsIfNoResultsOption) bool {
	if o2 == nil {
		return o.value == "none"
	}
	return o.value == o2.value
}
885476
func (i Int) Equal(other Argument) bool {
	if other.Typetag() != TypetagInt {
		return false
	}
	i2 := other.(Int)
	return i == i2
}
61100
func (self FloatEqualer) Equal(e Equaler) bool {
	return self.F == e.(FloatEqualer).F
}
323670
func (o *FiltersOption) Equal(o2 *FiltersOption) bool {
	if o2 == nil {
		return o.value == "attribute"
	}
	return o.value == o2.value
}
1363500
func (o *InsidePolygonOption) Equal(o2 *InsidePolygonOption) bool {
	if o2 == nil {
		return len(o.polygons) == 0 && len(o.coordinates) == 0
	}
	return reflect.DeepEqual(o, o2)
}
715201
func (o *IndexNameOption) Equal(o2 *IndexNameOption) bool {
	if o2 == nil {
		return o.value == ""
	}
	return o.value == o2.value
}
690224
func (o *SeparatorsToIndexOption) Equal(o2 *SeparatorsToIndexOption) bool {
	if o2 == nil {
		return o.value == ""
	}
	return o.value == o2.value
}
1204935
func Equal(err1 error, err2 error) bool {
	if err1 == err2 {
		return true
	}

	if v, ok := err1.(*error2); ok {
		return Equal(v.Inner, err2)
	}

	if v, ok := err2.(*error2); ok {
		return Equal(v.Inner, err1)
	}

	return false
}