// IsEmpty checks all collections on FullStatus to determine if the status is empty.
// Note that only the collections are checked here as Model information will always be populated.
498351
func (fs *FullStatus) IsEmpty() bool {
	return len(fs.Applications) == 0 &&
		len(fs.Machines) == 0 &&
		len(fs.Offers) == 0 &&
		len(fs.RemoteApplications) == 0 &&
		len(fs.Relations) == 0
}
368530
func (icon *Icon) IsEmpty() bool {
	return icon.URL == "" &&
		icon.Height == "" &&
		icon.Width == ""
}
789693
func IsEmpty(path string, fs afero.Fs) (bool, error) {
	return afero.IsEmpty(fs, path)
}
617615
func (q *Queue) Empty() bool {
	q.lock.Lock()
	defer q.lock.Unlock()

	return len(q.items) == 0
}
1311714
func (b *Bounds) IsEmpty() bool {
	if b.layout == NoLayout {
		return true
	}
	for i, stride := 0, b.layout.Stride(); i < stride; i++ {
		if b.max[i] < b.min[i] {
			return true
		}
	}
	return false
}
757731
func Isempty(db XODB, v0 pgtypes.Anyrange) (bool, error) {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.isempty($1)`

	// run query
	var ret bool
	XOLog(sqlstr, v0)
	err = db.QueryRow(sqlstr, v0).Scan(&ret)
	if err != nil {
		return false, err
	}

	return ret, nil
}
701846
func (engine *Engine) IsTableEmpty(bean interface{}) (bool, error) {
	session := engine.NewSession()
	defer session.Close()
	return session.IsTableEmpty(bean)
}
931906
func (bA *BitArray) IsEmpty() bool {
	if bA == nil {
		return true // should this be opposite?
	}
	bA.mtx.Lock()
	defer bA.mtx.Unlock()
	for _, e := range bA.Elems {
		if e > 0 {
			return false
		}
	}
	return true
}
858008
func isEmpty(path string) bool {
	fi, err := os.Stat(path)
	if err != nil {
		er(err)
	}

	if !fi.IsDir() {
		return fi.Size() == 0
	}

	f, err := os.Open(path)
	if err != nil {
		er(err)
	}
	defer f.Close()

	names, err := f.Readdirnames(-1)
	if err != nil && err != io.EOF {
		er(err)
	}

	for _, name := range names {
		if len(name) > 0 && name[0] != '.' {
			return false
		}
	}
	return true
}
741810
func (v mergeStrategy) MergeEmpty(diff apply.EmptyElement) (apply.Result, error) {
	return apply.Result{Operation: apply.SET}, nil
}
1069679
func IsEmpty(v interface{}) bool {
	switch val := v.(type) {
	case reflect.Value:
		return isEmptyValue(val)
	case *reflect.Value:
		if val == nil {
			return true
		}
		return isEmptyValue(*val)
	default:
		return isEmptyValue(reflect.ValueOf(v))
	}
}
698465
func Empty(xu *xgbutil.XUtil) bool {
	xu.EvqueueLck.RLock()
	defer xu.EvqueueLck.RUnlock()

	return len(xu.Evqueue) == 0
}
581198
func checkModelEntityRefsEmpty(doc *modelEntityRefsDoc) ([]txn.Op, error) {
	// These errors could be potentially swallowed as we re-try to destroy model.
	// Let's, at least, log them for observation.
	err := modelNotEmptyError{
		machines:     len(doc.Machines),
		applications: len(doc.Applications),
		volumes:      len(doc.Volumes),
		filesystems:  len(doc.Filesystems),
	}
	if err != (modelNotEmptyError{}) {
		return nil, err
	}

	isEmpty := func(attribute string) bson.DocElem {
		// We consider it empty if the array has no entries, or if the attribute doesn't exist
		return bson.DocElem{
			"$or", []bson.M{{
				attribute: bson.M{"$exists": false},
			}, {
				attribute: bson.M{"$size": 0},
			}},
		}
	}

	return []txn.Op{{
		C:  modelEntityRefsC,
		Id: doc.UUID,
		Assert: bson.D{
			isEmpty("machines"),
			isEmpty("applications"),
			isEmpty("volumes"),
			isEmpty("filesystems"),
		},
	}}, nil
}
1190497
func dropEmpty(list []*string) []string {
	var l []string
	for _, s := range list {
		if *s != "" {
			l = append(l, *s)
		}
	}
	return l
}
644075
func isEmpty(a *Automaton) bool {
	if a.numStates() == 0 {
		// common case: no states
		return true
	}
	if !a.IsAccept(0) && a.numTransitions(0) == 0 {
		// common case: just one initial state
		return true
	}
	if a.IsAccept(0) {
		// apparently common case: it accepts the empty string
		return false
	}

	workList := list.New()
	seen := util.NewOpenBitSet()
	workList.PushBack(0)
	seen.Set(0)

	t := newTransition()
	for workList.Len() > 0 {
		state := workList.Remove(workList.Front()).(int)
		if a.IsAccept(state) {
			return false
		}
		count := a.initTransition(state, t)
		for i := 0; i < count; i++ {
			a.nextTransition(t)
			if !seen.Get(int64(t.dest)) {
				workList.PushBack(t.dest)
				seen.Set(int64(t.dest))
			}
		}
	}

	return true
}
1191581
func (c WriteCondition) IfEmpty(key []string) WriteCondition {
	return c.add(key, func(wc *writeCondition) {
		wc.OldEmpty = &condTrue
	})
}
1167177
func isEmpty(object interface{}) bool {

	if object == nil {
		return true
	} else if object == "" {
		return true
	} else if object == false {
		return true
	}

	for _, v := range numericZeros {
		if object == v {
			return true
		}
	}

	objValue := reflect.ValueOf(object)

	switch objValue.Kind() {
	case reflect.Map:
		fallthrough
	case reflect.Slice, reflect.Chan:
		{
			return (objValue.Len() == 0)
		}
	case reflect.Struct:
		switch object.(type) {
		case time.Time:
			return object.(time.Time).IsZero()
		}
	case reflect.Ptr:
		{
			if objValue.IsNil() {
				return true
			}
			switch object.(type) {
			case *time.Time:
				return object.(*time.Time).IsZero()
			default:
				return false
			}
		}
	}
	return false
}