// hasCBDDescendent returns true if any descendent (node that depends on this)
// has CBD set.
543604
func (t *ForcedCBDTransformer) hasCBDDescendent(g *Graph, v dag.Vertex) bool {
	s, _ := g.Descendents(v)
	if s == nil {
		return true
	}

	for _, ov := range s.List() {
		dn, ok := ov.(GraphNodeDestroyerCBD)
		if !ok {
			continue
		}

		if dn.CreateBeforeDestroy() {
			// some descendent is CreateBeforeDestroy, so we need to follow suit
			log.Printf("[TRACE] ForcedCBDTransformer: %q has CBD descendent %q", dag.VertexName(v), dag.VertexName(ov))
			return true
		}
	}

	return false
}
1062726
func (t *BTree) Ascend(iterator ItemIterator) {
	if t.root == nil {
		return
	}
	t.root.iterate(ascend, nil, nil, false, false, iterator)
}
757802
func (db *MemDB) Has(key []byte) bool {
	db.mtx.Lock()
	defer db.mtx.Unlock()
	key = nonNilBytes(key)

	_, ok := db.db[string(key)]
	return ok
}
347060
func (p *pathTree) has(rel string) bool {
	if p == nil {
		return false
	}

	if !p.caseSensitive {
		rel = strings.ToLower(rel)
	}

	// It matches some added entry exactly?
	if p.leafs.Has(rel) {
		return true
	}
	// Was added as a parent of some entry?
	if p.nodes.Has(rel) {
		return true
	}

	// Maybe it has some added entry as its parent?
	found := false
	parentDirs(rel, func(par string) bool {
		found = p.leafs.Has(par)
		return !found
	})
	return found
}
1282585
func cBBool(x bool) C.CK_BBOOL {
	if x {
		return C.CK_BBOOL(C.CK_TRUE)
	}
	return C.CK_BBOOL(C.CK_FALSE)
}
191030
func isRedundant(e *edgeInfo) bool {
	destPred := predecessors(e, e.dest)
	if len(destPred) == 1 {
		return false
	}
	srcPred := predecessors(e, e.src)

	for n := range srcPred {
		if destPred[n] && n != e.dest {
			return true
		}
	}
	return false
}
282973
func (cb ConditionBuilder) buildChildNodes() ([]exprNode, error) {
	childNodes := make([]exprNode, 0, len(cb.conditionList)+len(cb.operandList))
	for _, condition := range cb.conditionList {
		node, err := condition.buildTree()
		if err != nil {
			return []exprNode{}, err
		}
		childNodes = append(childNodes, node)
	}
	for _, ope := range cb.operandList {
		operand, err := ope.BuildOperand()
		if err != nil {
			return []exprNode{}, err
		}
		childNodes = append(childNodes, operand.exprNode)
	}

	return childNodes, nil
}
276419
func (n *node) hasDuplicateSibling(key interface{}) bool {
	if n.parent == nil {
		return false
	}
	for _, sibling := range n.parent.children {
		if sibling == n {
			continue
		}
		if sibling.content.key() == key {
			return true
		}
	}
	return false
}
1137773
func (u *UniterAPI) HasSubordinates(args params.Entities) (params.BoolResults, error) {
	result := params.BoolResults{
		Results: make([]params.BoolResult, len(args.Entities)),
	}
	canAccess, err := u.accessUnit()
	if err != nil {
		return params.BoolResults{}, err
	}
	for i, entity := range args.Entities {
		tag, err := names.ParseUnitTag(entity.Tag)
		if err != nil {
			result.Results[i].Error = common.ServerError(common.ErrPerm)
			continue
		}
		err = common.ErrPerm
		if canAccess(tag) {
			var unit *state.Unit
			unit, err = u.getUnit(tag)
			if err == nil {
				subordinates := unit.SubordinateNames()
				result.Results[i].Result = len(subordinates) > 0
			}
		}
		result.Results[i].Error = common.ServerError(err)
	}
	return result, nil
}
1024206
func (p *PKGBUILD) IsDevel() bool {
	for _, name := range p.Pkgnames {
		if strings.HasSuffix(name, "-git") {
			return true
		}

		if strings.HasSuffix(name, "-svn") {
			return true
		}

		if strings.HasSuffix(name, "-hg") {
			return true
		}

		if strings.HasSuffix(name, "-bzr") {
			return true
		}
	}

	return false
}
329438
func (dns *dnsControl) HasSynced() bool {
	a := dns.svcController.HasSynced()
	b := true
	if dns.epController != nil {
		b = dns.epController.HasSynced()
	}
	c := true
	if dns.podController != nil {
		c = dns.podController.HasSynced()
	}
	d := dns.nsController.HasSynced()
	return a && b && c && d
}
1037236
func isBIP0030Node(node *blockNode) bool {
	if node.height == 91842 && node.hash.IsEqual(block91842Hash) {
		return true
	}

	if node.height == 91880 && node.hash.IsEqual(block91880Hash) {
		return true
	}

	return false
}
906077
func (m *MemLogger) HasFunc(f func(*LogEntry) bool) bool {
	return m.GetFunc(f) != nil
}
617740
func hasMorphism(via interface{}, rev bool, nodes ...quad.Value) morphism {
	var node shape.Shape
	if len(nodes) == 0 {
		node = shape.AllNodes{}
	} else {
		node = shape.Lookup(nodes)
	}
	return hasShapeMorphism(via, rev, node)
}
618554
func (v *TreeVertex) selectDescendants(indices []int) []*TreeVertex {
	r := make([]*TreeVertex, len(indices))
	i := 0
	for _, index := range indices {
		r[i] = v.Descendants[index]
		i++
	}
	return r
}
656480
func HasRCSBackend(ctx context.Context) bool {
	_, ok := ctx.Value(ctxKeyRCSBackend).(RCSBackend)
	return ok
}
364024
func (t *BTree) AscendLessThan(pivot Item, iterator ItemIterator) {
	if t.root == nil {
		return
	}
	t.root.iterate(ascend, nil, pivot, false, false, iterator)
}