// computeEqualPlan computes the plan for an equality constraint.
774625
func (ro *routeOption) computeEqualPlan(pb *primitiveBuilder, comparison *sqlparser.ComparisonExpr) (opcode engine.RouteOpcode, vindex vindexes.Vindex, condition sqlparser.Expr) {
	left := comparison.Left
	right := comparison.Right
	vindex = ro.FindVindex(pb, left)
	if vindex == nil {
		left, right = right, left
		vindex = ro.FindVindex(pb, left)
		if vindex == nil {
			return engine.SelectScatter, nil, nil
		}
	}
	if !ro.exprIsValue(right) {
		return engine.SelectScatter, nil, nil
	}
	if vindex.IsUnique() {
		return engine.SelectEqualUnique, vindex, right
	}
	return engine.SelectEqual, vindex, right
}
68569
func (p PortConfiguration) DeepEquals(o PortConfiguration) bool {
	if len(p) != len(o) {
		return false
	}

	for portName1, port1 := range p {
		port2, ok := o[portName1]

		if !ok || !port1.Equals(port2) {
			return false
		}
	}

	return true
}
286595
func Eq(expectedValue interface{}) *eqMatcher {
	matcher := new(eqMatcher)
	matcher.expectedValue = expectedValue
	return matcher
}
1248193
func RankingEqual(o1, o2 *RankingOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
1208115
func (s *SyncedSet) Equal(other *SyncedSet) bool {
	s.RLock()
	defer s.RUnlock()
	test := reflect.DeepEqual(s.set, other.set)
	return test
}
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)))
}
1201775
func (t proofTerm) equal(u proofTerm) bool {
	return t.seqno() == u.seqno()
}
148609
func ipNetEqual(ipn1 *net.IPNet, ipn2 *net.IPNet) bool {
	if ipn1 == ipn2 {
		return true
	}
	if ipn1 == nil || ipn2 == nil {
		return false
	}
	m1, _ := ipn1.Mask.Size()
	m2, _ := ipn2.Mask.Size()
	return m1 == m2 && ipn1.IP.Equal(ipn2.IP)
}
734142
func evaluateNodePlan(snap *state.StateSnapshot, plan *structs.Plan, nodeID string) (bool, string, error) {
	// If this is an evict-only plan, it always 'fits' since we are removing things.
	if len(plan.NodeAllocation[nodeID]) == 0 {
		return true, "", nil
	}

	// Get the node itself
	ws := memdb.NewWatchSet()
	node, err := snap.NodeByID(ws, nodeID)
	if err != nil {
		return false, "", fmt.Errorf("failed to get node '%s': %v", nodeID, err)
	}

	// If the node does not exist or is not ready for scheduling it is not fit
	// XXX: There is a potential race between when we do this check and when
	// the Raft commit happens.
	if node == nil {
		return false, "node does not exist", nil
	} else if node.Status != structs.NodeStatusReady {
		return false, "node is not ready for placements", nil
	} else if node.SchedulingEligibility == structs.NodeSchedulingIneligible {
		return false, "node is not eligible for draining", nil
	} else if node.Drain {
		// Deprecate in favor of scheduling eligibility and remove post-0.8
		return false, "node is draining", nil
	}

	// Get the existing allocations that are non-terminal
	existingAlloc, err := snap.AllocsByNodeTerminal(ws, nodeID, false)
	if err != nil {
		return false, "", fmt.Errorf("failed to get existing allocations for '%s': %v", nodeID, err)
	}

	// Determine the proposed allocation by first removing allocations
	// that are planned evictions and adding the new allocations.
	var remove []*structs.Allocation
	if update := plan.NodeUpdate[nodeID]; len(update) > 0 {
		remove = append(remove, update...)
	}

	// Remove any preempted allocs
	if preempted := plan.NodePreemptions[nodeID]; len(preempted) > 0 {
		remove = append(remove, preempted...)
	}

	if updated := plan.NodeAllocation[nodeID]; len(updated) > 0 {
		remove = append(remove, updated...)
	}
	proposed := structs.RemoveAllocs(existingAlloc, remove)
	proposed = append(proposed, plan.NodeAllocation[nodeID]...)

	// Check if these allocations fit
	fit, reason, _, err := structs.AllocsFit(node, proposed, nil, true)
	return fit, reason, err
}
306537
func (ro *routeOption) computePlan(pb *primitiveBuilder, filter sqlparser.Expr) (opcode engine.RouteOpcode, vindex vindexes.Vindex, condition sqlparser.Expr) {
	switch node := filter.(type) {
	case *sqlparser.ComparisonExpr:
		switch node.Operator {
		case sqlparser.EqualStr:
			return ro.computeEqualPlan(pb, node)
		case sqlparser.InStr:
			return ro.computeINPlan(pb, node)
		}
	case *sqlparser.ParenExpr:
		return ro.computePlan(pb, node.Expr)
	}
	return engine.SelectScatter, nil, nil
}
381888
func PercentileComputationEqual(o1, o2 *PercentileComputationOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
907215
func (c Coord) Equal(layout Layout, other Coord) bool {
	numOrds := len(c)

	if layout.Stride() < numOrds {
		numOrds = layout.Stride()
	}

	if (len(c) < layout.Stride() || len(other) < layout.Stride()) && len(c) != len(other) {
		return false
	}

	for i := 0; i < numOrds; i++ {
		if math.IsNaN(c[i]) || math.IsNaN(other[i]) {
			if !math.IsNaN(c[i]) || !math.IsNaN(other[i]) {
				return false
			}
		} else if c[i] != other[i] {
			return false
		}
	}

	return true
}
981131
func EqualitiesOrDie(funcs ...interface{}) Equalities {
	e := Equalities{}
	if err := e.AddFuncs(funcs...); err != nil {
		panic(err)
	}
	return e
}
917831
func (b Bound) Equal(c Bound) bool {
	return b.Min == c.Min && b.Max == c.Max
}
229761
func Equal(g1, g2 Geometry) bool {
	if g1 == nil || g2 == nil {
		return g1 == g2
	}

	if g1.GeoJSONType() != g2.GeoJSONType() {
		return false
	}

	switch g1 := g1.(type) {
	case Point:
		return g1.Equal(g2.(Point))
	case MultiPoint:
		return g1.Equal(g2.(MultiPoint))
	case LineString:
		return g1.Equal(g2.(LineString))
	case MultiLineString:
		return g1.Equal(g2.(MultiLineString))
	case Ring:
		g2, ok := g2.(Ring)
		if !ok {
			return false
		}
		return g1.Equal(g2)
	case Polygon:
		g2, ok := g2.(Polygon)
		if !ok {
			return false
		}
		return g1.Equal(g2)
	case MultiPolygon:
		return g1.Equal(g2.(MultiPolygon))
	case Collection:
		return g1.Equal(g2.(Collection))
	case Bound:
		g2, ok := g2.(Bound)
		if !ok {
			return false
		}
		return g1.Equal(g2)
	}

	panic(fmt.Sprintf("geometry type not supported: %T", g1))
}
49646
func (self *AttributeImpl) SetEqualer(i Equaler) {
	if !self.source() {
		panic("can't set a value on something that is not a source!")
	}
	//no change?
	if self.curr != nil && self.curr.Equal(i) {
		return
	}

	//mark dirty on all reachable nodes
	self.markDirty()

	//mark immediate outgoing edges
	self.walkOutgoing(func(e *edgeImpl) {
		e.mark()
	})
	self.assign(i, true)
	DrainEagerQueue()
}
145720
func EqualDepth(x, y Value, depth int) (bool, error) {
	return CompareDepth(syntax.EQL, x, y, depth)
}