// same reports whether x and y are identical, or both are PkgNames
// that import the same Package.
967288
func sameObj(x, y types.Object) bool {
	if x == y {
		return true
	}
	if x, ok := x.(*types.PkgName); ok {
		if y, ok := y.(*types.PkgName); ok {
			return x.Imported() == y.Imported()
		}
	}
	return false
}
1040647
func Equal(x, y Value) (bool, error) {
	if x, ok := x.(String); ok {
		return x == y, nil // fast path for an important special case
	}
	return EqualDepth(x, y, maxdepth)
}
1234671
func (m *MenuEntry) IsEqual(inme *MenuEntry) bool {
	return m.hopefullyUniqueID() == inme.hopefullyUniqueID() && m.Parent == inme.Parent
}
173941
func (k1 Key) Equal(k2 Key) bool {
	if k1.Space != k2.Space {
		panic("k1 and k2 not in same key space.")
	}
	return k1.Space.Equal(k1, k2)
}
859196
func (v PreciseVector) Equal(ov PreciseVector) bool {
	return v.X.Cmp(ov.X) == 0 && v.Y.Cmp(ov.Y) == 0 && v.Z.Cmp(ov.Z) == 0
}
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
}
915700
func (d *Diff) Equal(d2 *Diff) bool {
	// If one is nil, they must both be nil
	if d == nil || d2 == nil {
		return d == d2
	}

	// Sort the modules
	sort.Sort(moduleDiffSort(d.Modules))
	sort.Sort(moduleDiffSort(d2.Modules))

	// Copy since we have to modify the module destroy flag to false so
	// we don't compare that. TODO: delete this when we get rid of the
	// destroy flag on modules.
	dCopy := d.DeepCopy()
	d2Copy := d2.DeepCopy()
	for _, m := range dCopy.Modules {
		m.Destroy = false
	}
	for _, m := range d2Copy.Modules {
		m.Destroy = false
	}

	// Use DeepEqual
	return reflect.DeepEqual(dCopy, d2Copy)
}
841990
func (na *NetAddress) Same(other interface{}) bool {
	if o, ok := other.(*NetAddress); ok {
		if na.DialString() == o.DialString() {
			return true
		}
		if na.ID != "" && na.ID == o.ID {
			return true
		}
	}
	return false
}
458975
func CmdLabelMapsEqual(a, b map[string]CommandLabel) bool {
	if len(a) != len(b) {
		return false
	}
	for key, val := range a {
		val2, ok := b[key]
		if !ok {
			return false
		}
		if !val.Equals(val2) {
			return false
		}
	}
	return true
}
225708
func Equal(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {

	if !ObjectsAreEqual(expected, actual) {
		diff := diff(expected, actual)
		return Fail(t, fmt.Sprintf("Not equal: %#v (expected)\n"+
			"        != %#v (actual)%s", expected, actual, diff), msgAndArgs...)
	}

	return true

}
354085
func (p Polyline) Equals(other core.DxfElement) bool {
	if otherPolyline, ok := other.(*Polyline); ok {
		return p.BaseEntity.Equals(otherPolyline.BaseEntity) &&
			core.FloatEquals(p.Elevation, otherPolyline.Elevation) &&
			core.FloatEquals(p.Thickness, otherPolyline.Thickness) &&
			p.Closed == otherPolyline.Closed &&
			p.CurveFitVerticesAdded == otherPolyline.CurveFitVerticesAdded &&
			p.SplineFitVerticesAdded == otherPolyline.SplineFitVerticesAdded &&
			p.Is3dPolyline == otherPolyline.Is3dPolyline &&
			p.Is3dPolygonMesh == otherPolyline.Is3dPolygonMesh &&
			p.PolygonMeshClosedNDir == otherPolyline.PolygonMeshClosedNDir &&
			p.IsPolyfaceMesh == otherPolyline.IsPolyfaceMesh &&
			p.LineTypeParentAround == otherPolyline.LineTypeParentAround &&
			core.FloatEquals(p.DefaultStartWidth, otherPolyline.DefaultStartWidth) &&
			core.FloatEquals(p.DefaultEndWidth, otherPolyline.DefaultEndWidth) &&
			p.VertexCountM == otherPolyline.VertexCountM &&
			p.VertexCountN == otherPolyline.VertexCountN &&
			p.SmoothDensityM == otherPolyline.SmoothDensityM &&
			p.SmoothDensityN == otherPolyline.SmoothDensityN &&
			p.SmoothSurface == otherPolyline.SmoothSurface &&
			p.ExtrusionDirection.Equals(otherPolyline.ExtrusionDirection) &&
			p.Vertices.Equals(otherPolyline.Vertices)
	}
	return false
}
349366
func PrimaryEqual(o1, o2 *PrimaryOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
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)
}
316571
func (v Version) Equals(o *Version) bool {
	if o == nil {
		return v.IsZero()
	}

	if v.Scalar == o.Scalar && v.PID == o.PID {
		return true
	}
	return false
}
982177
func SameNext(next1, next2 Handler) bool {
	return fmt.Sprintf("%v", next1) == fmt.Sprintf("%v", next2)
}
845211
func (m *Projection) Equal(t Task) bool {
	if m == nil && t == nil {
		return true
	}
	if m == nil && t != nil {
		return false
	}
	if m != nil && t == nil {
		return false
	}
	s, ok := t.(*Projection)
	if !ok {
		return false
	}
	if m.Final != s.Final {
		return false
	}
	if !m.Proj.Equal(s.Proj) {
		return false
	}
	if !m.PlanBase.EqualBase(s.PlanBase) {
		return false
	}
	return true
}
413494
func (c Vertex) Equals(other core.DxfElement) bool {
	if otherVertex, ok := other.(*Vertex); ok {
		return c.BaseEntity.Equals(otherVertex.BaseEntity) &&
			c.Location.Equals(otherVertex.Location) &&
			core.FloatEquals(c.StartingWidth, otherVertex.StartingWidth) &&
			core.FloatEquals(c.EndWidth, otherVertex.EndWidth) &&
			core.FloatEquals(c.Bulge, otherVertex.Bulge) &&
			c.CreatedByCurveFitting == otherVertex.CreatedByCurveFitting &&
			c.CurveFitTangentDefined == otherVertex.CurveFitTangentDefined &&
			c.SplineVertex == otherVertex.SplineVertex &&
			c.SplineFrameCtrlPoint == otherVertex.SplineFrameCtrlPoint &&
			c.Is3dPolylineVertex == otherVertex.Is3dPolylineVertex &&
			c.Is3dPolylineMesh == otherVertex.Is3dPolylineMesh &&
			c.IsPolyfaceMeshVertex == otherVertex.IsPolyfaceMeshVertex &&
			core.FloatEquals(c.CurveFitTangentDirection,
				otherVertex.CurveFitTangentDirection) &&
			c.Id == otherVertex.Id
	}
	return false
}