// typeEqual accepts any two types and returns true if they are equal.
484992
func typeEqual(t1, t2 confType) bool {
	if t1 == nil || t2 == nil {
		return false
	}
	return t1.typeString() == t2.typeString()
}
767655
func Equal(t testing.TB, v1, v2 interface{}, args ...interface{}) {
	assert(t, IsEqual(v1, v2), args, []interface{}{"Equal 失败，实际值为v1=[%T:%[1]v];v2=[%T:%[2]v]", v1, v2})
}
360822
func IsEqual(data sort.Interface, pivot int) bool {
	k, l := pivot, data.Len()
	if k*2 != l {
		return false
	}
	for i := 0; i < k; i++ {
		p, q := k-i-1, l-i-1
		if data.Less(p, q) || data.Less(q, p) {
			return false
		}
	}
	return true
}
286244
func Equals(a interface{}, b interface{}) BoolPredicate {
	return func() bool {
		switch aval := a.(type) {
		case string:
			bval, ok := b.(string)
			return ok && aval == bval
		case []string:
			bval, ok := b.([]string)
			if !ok {
				return false
			}
			if len(aval) != len(bval) {
				return false
			}
			for i := range aval {
				if aval[i] != bval[i] {
					return false
				}
			}
			return true
		default:
			return false
		}
	}
}
1234671
func (m *MenuEntry) IsEqual(inme *MenuEntry) bool {
	return m.hopefullyUniqueID() == inme.hopefullyUniqueID() && m.Parent == inme.Parent
}
1308794
func (hash *Hash) IsEqual(target *Hash) bool {
	if hash == nil && target == nil {
		return true
	}
	if hash == nil || target == nil {
		return false
	}
	return *hash == *target
}
1148363
func (e *Error) Equal(ie interface{}) bool {
	if ie == nil || e == nil || e.err == nil {
		return false
	}
	switch val := ie.(type) {
	case *Error:
		if val == nil {
			return false
		}
		if val.err == nil {
			return false
		}
		return e.err.Error() == val.String()
	case error:
		if val == nil {
			return false
		}
		return e.err.Error() == val.Error()
	case string:
		return e.err.Error() == val
	default:
		panic("invalid type")
	}
}
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
}
1162700
func (v *TypeReference) Equals(rhs *TypeReference) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.Name == rhs.Name) {
		return false
	}
	if !(v.ImportPath == rhs.ImportPath) {
		return false
	}
	if !((v.Annotations == nil && rhs.Annotations == nil) || (v.Annotations != nil && rhs.Annotations != nil && _Map_String_String_Equals(v.Annotations, rhs.Annotations))) {
		return false
	}

	return true
}
680887
func RowsEqual(left, right []sqltypes.Value) int {
	for i, l := range left {
		if !bytes.Equal(l.Raw(), right[i].Raw()) {
			return i
		}
	}
	return -1
}
1247444
func equals(a, b interface{}) bool {
	sameType := reflect.TypeOf(a) == reflect.TypeOf(b)
	if _, ok := a.([]byte); ok {
		if _, ok := b.([]byte); !ok {
			// panic(fmt.Sprintf("incomparable type: %v vs %v", a, b))
			return false
		}
		b1 := a.([]byte)
		b2 := b.([]byte)
		if len(b1) != len(b2) {
			return false
		}
		for i := 0; i < len(b1) && i < len(b2); i++ {
			if b1[i] != b2[i] {
				return false
			}
		}
		return true
	} else if _, ok := a.(int64); ok {
		if _, ok := b.(int64); !ok {
			// panic(fmt.Sprintf("incomparable type: %v vs %v", a, b))
			return false
		}
		return a.(int64) == b.(int64)
	} else if a == nil && b == nil {
		return true
	} else if sameType && a == b {
		return true
	}
	return false
}
794574
func Equal(a, b interface{}) bool {
	if a == nil && b == nil {
		return a == b
	}

	return reflect.DeepEqual(a, b)
}
946619
func (v *ListTypeVersioningV1) Equals(rhs *ListTypeVersioningV1) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Myints == nil && rhs.Myints == nil) || (v.Myints != nil && rhs.Myints != nil && _List_I32_Equals(v.Myints, rhs.Myints))) {
		return false
	}
	if !_String_EqualsPtr(v.Hello, rhs.Hello) {
		return false
	}

	return true
}
645272
func check_type_expr(e ast.Expr) bool {
	switch t := e.(type) {
	case *ast.StarExpr:
		return check_type_expr(t.X)
	case *ast.ArrayType:
		return check_type_expr(t.Elt)
	case *ast.SelectorExpr:
		return check_type_expr(t.X)
	case *ast.FuncType:
		a := check_func_field_list(t.Params)
		b := check_func_field_list(t.Results)
		return a && b
	case *ast.MapType:
		a := check_type_expr(t.Key)
		b := check_type_expr(t.Value)
		return a && b
	case *ast.Ellipsis:
		return check_type_expr(t.Elt)
	case *ast.ChanType:
		return check_type_expr(t.Value)
	case *ast.BadExpr:
		return false
	default:
		return true
	}
}
767234
func (v *TypePair) Equals(rhs *TypePair) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !v.Left.Equals(rhs.Left) {
		return false
	}
	if !v.Right.Equals(rhs.Right) {
		return false
	}

	return true
}
295245
func generateEqual(this, that *MyStruct) bool {
	return (this == nil && that == nil) ||
		this != nil && that != nil &&
			this.Int64 == that.Int64 &&
			((this.StringPtr == nil && that.StringPtr == nil) || (this.StringPtr != nil && that.StringPtr != nil && *(this.StringPtr) == *(that.StringPtr)))
}
85649
func QueryEqual(o1, o2 *QueryOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}