// isEmpty gets whether the specified object is considered empty or not.
432417
func isEmpty(object interface{}) bool {

	// get nil case out of the way
	if object == nil {
		return true
	}

	objValue := reflect.ValueOf(object)

	switch objValue.Kind() {
	// collection types are empty when they have no element
	case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
		return objValue.Len() == 0
	// pointers are empty if nil or if the value they point to is empty
	case reflect.Ptr:
		if objValue.IsNil() {
			return true
		}
		deref := objValue.Elem().Interface()
		return isEmpty(deref)
	// for all other types, compare against the zero value
	default:
		zero := reflect.Zero(objValue.Type())
		return reflect.DeepEqual(object, zero.Interface())
	}
}
1070005
func (q *Quest_Desc_Meta_Retry) IsEmpty() bool {
	return q.Crashed == 0 && q.Expired == 0 && q.Failed == 0 && q.TimedOut == 0
}
117858
func isEmptyLayer(compatHistory []byte) (bool, error) {
	var h v1History
	if err := json.Unmarshal(compatHistory, &h); err != nil {
		return false, err
	}

	if h.ThrowAway != nil {
		return *h.ThrowAway, nil
	}
	if h.Size != nil {
		return *h.Size == 0, nil
	}

	// If no `Size` or `throwaway` field is given, then
	// it cannot be determined whether the layer is empty
	// from the history, return false
	return false, nil
}
1161700
func IsEmptyDir(root string) (bool, error) {
	if _, err := os.Stat(root); err != nil && os.IsNotExist(err) {
		return true, nil
	}

	fs, os, err := dirFiles(root)
	if err != nil {
		return false, err
	}

	return len(fs) == 0 && len(os) == 0, nil
}
978625
func (enc *Encoder) ObjectOmitEmpty(v MarshalerJSONObject) {
	if v.IsNil() {
		return
	}
	enc.grow(2)
	r := enc.getPreviousRune()
	if r != '[' {
		enc.writeByte(',')
	}
	enc.writeByte('{')

	var origHasKeys = enc.hasKeys
	var origKeys = enc.keys
	enc.hasKeys = false
	enc.keys = nil

	v.MarshalJSONObject(enc)

	enc.hasKeys = origHasKeys
	enc.keys = origKeys

	enc.writeByte('}')
}
192222
func isEmptyValue(v reflect.Value, tinfos *TypeInfos, deref, checkStruct bool) bool {
	urv := (*unsafeReflectValue)(unsafe.Pointer(&v))
	if urv.flag == 0 {
		return true
	}
	switch v.Kind() {
	case reflect.Invalid:
		return true
	case reflect.String:
		return (*unsafeString)(urv.ptr).Len == 0
	case reflect.Slice:
		return (*unsafeSlice)(urv.ptr).Len == 0
	case reflect.Bool:
		return !*(*bool)(urv.ptr)
	case reflect.Int:
		return *(*int)(urv.ptr) == 0
	case reflect.Int8:
		return *(*int8)(urv.ptr) == 0
	case reflect.Int16:
		return *(*int16)(urv.ptr) == 0
	case reflect.Int32:
		return *(*int32)(urv.ptr) == 0
	case reflect.Int64:
		return *(*int64)(urv.ptr) == 0
	case reflect.Uint:
		return *(*uint)(urv.ptr) == 0
	case reflect.Uint8:
		return *(*uint8)(urv.ptr) == 0
	case reflect.Uint16:
		return *(*uint16)(urv.ptr) == 0
	case reflect.Uint32:
		return *(*uint32)(urv.ptr) == 0
	case reflect.Uint64:
		return *(*uint64)(urv.ptr) == 0
	case reflect.Uintptr:
		return *(*uintptr)(urv.ptr) == 0
	case reflect.Float32:
		return *(*float32)(urv.ptr) == 0
	case reflect.Float64:
		return *(*float64)(urv.ptr) == 0
	case reflect.Interface:
		isnil := urv.ptr == nil || *(*unsafe.Pointer)(urv.ptr) == nil
		if deref {
			if isnil {
				return true
			}
			return isEmptyValue(v.Elem(), tinfos, deref, checkStruct)
		}
		return isnil
	case reflect.Ptr:
		// isnil := urv.ptr == nil (not sufficient, as a pointer value encodes the type)
		isnil := urv.ptr == nil || *(*unsafe.Pointer)(urv.ptr) == nil
		if deref {
			if isnil {
				return true
			}
			return isEmptyValue(v.Elem(), tinfos, deref, checkStruct)
		}
		return isnil
	case reflect.Struct:
		return isEmptyStruct(v, tinfos, deref, checkStruct)
	case reflect.Map, reflect.Array, reflect.Chan:
		return v.Len() == 0
	}
	return false
}
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
}
491743
func isEmpty(c yaml.Constraint) bool {
	return len(c.Include) == 0 && len(c.Exclude) == 0
}
61014
func (q *Queue) IsEmpty() bool {
	q.mu.Lock()
	defer q.mu.Unlock()

	return q.list.Front() == nil
}
967970
func (p *Projection) IsEmpty() bool {
	return p.Binding == "" && p.Alias == "" && p.OP == lexer.ItemError && p.Modifier == lexer.ItemError
}
1291308
func (t *TopologyChange) isEmpty() bool {
	return len(t.NodeUpdates) == 0 && len(t.ChannelEdgeUpdates) == 0 &&
		len(t.ClosedChannels) == 0
}
574544
func (r *resourceRecordChangeset) IsEmpty() bool {
	if len(r.additions) == 0 && len(r.removals) == 0 && len(r.upserts) == 0 {
		return true
	}

	return false
}
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
}
33752
func (q *Query) IsEmpty() bool {
	if q.index != "" {
		return false
	}
	if len(q.fieldCriteria) != 0 {
		return false
	}

	if q.ors != nil {
		return false
	}

	return true
}
318172
func (session *Session) IsTableEmpty(bean interface{}) (bool, error) {
	if session.isAutoClose {
		defer session.Close()
	}
	return session.isTableEmpty(session.engine.TableName(bean))
}
995317
func (l *Log) isEmpty() bool {
	l.mutex.RLock()
	defer l.mutex.RUnlock()
	return (len(l.entries) == 0) && (l.startIndex == 0)
}