// isMissing says if a packet was reported missing in the last ACK.
338470
func (h *receivedPacketTracker) isMissing(p protocol.PacketNumber) bool {
	if h.lastAck == nil || p < h.ignoreBelow {
		return false
	}
	return p < h.lastAck.LargestAcked() && !h.lastAck.AcksPacket(p)
}
649579
func (r *GormRepository) checkNoWITIsMissing(ctx context.Context, s *ImportHelper) error {
	type idType struct {
		ID uuid.UUID `gorm:"column:id" sql:"type:uuid"`
	}
	var IDs []idType
	query := fmt.Sprintf(`SELECT id FROM "%s" WHERE space_template_id = ?`, workitem.WorkItemType{}.TableName())
	db := r.db.Raw(query, s.Template.ID.String()).Scan(&IDs)
	if db.Error != nil {
		return errs.Wrapf(db.Error, "failed to load all work item types for space template '%s'", s.Template.ID)
	}
	toBeFoundIDs := id.Map{}
	for _, i := range IDs {
		toBeFoundIDs[i.ID] = struct{}{}
	}
	for _, wit := range s.WITs {
		delete(toBeFoundIDs, wit.ID)
	}
	if len(toBeFoundIDs) > 0 {
		return errs.Errorf("work item types to be imported must not remove these existing work item types: %s", toBeFoundIDs)
	}
	return nil
}
327718
func IsIntersecting(rect1 engo.AABB, rect2 engo.AABB) bool {
	if rect1.Max.X > rect2.Min.X && rect1.Min.X < rect2.Max.X && rect1.Max.Y > rect2.Min.Y && rect1.Min.Y < rect2.Max.Y {
		return true
	}

	return false
}
526604
func (s Session) SessionTimeoutExpiredOrMissing() bool {
	if exp, present := s[TimestampKey]; !present {
		return true
	} else if exp == SessionValueName {
		return false
	} else if expInt, _ := strconv.Atoi(exp.(string)); int64(expInt) < time.Now().Unix() {
		return true
	}
	return false
}
840026
func (nc *Conn) IsReconnecting() bool {
	nc.mu.RLock()
	defer nc.mu.RUnlock()
	return nc.isReconnecting()
}
902073
func (g *gatewayCfg) isImplicit() bool {
	g.RLock()
	ii := g.implicit
	g.RUnlock()
	return ii
}
615870
func IsIncomplete(err error) bool {
	perr, ok := err.(ParseError)
	return ok && perr.Incomplete
}
1162758
func (service *BaseService) AddMissingMethod(method MissingMethod, option ...Options) Service {
	service.methodManager.AddMissingMethod(method, option...)
	return service
}
1045952
func (cb *configBased) CacheMisses(ns string, version int, id string) (uint64, error) {
	if cache, ok := cb.metricCache[id]; ok {
		return cache.cacheMisses(ns, version)
	}
	return 0, ErrCacheDoesNotExist
}
1292224
func appendIfMissing(slice []string, element string) []string {
	for _, ele := range slice {
		if ele == element {
			return slice
		}
	}
	return append(slice, element)
}
387763
func AppendIfMissing(slice []string, i string) []string {
	if StrListContains(slice, i) {
		return slice
	}
	return append(slice, i)
}
697711
func IsAccessDenied(e error) bool {
	type ad interface {
		IsAccessDeniedError() bool
	}
	_, ok := Unwrap(e).(ad)
	return ok
}
1274827
func (s *Server) isRunning() bool {
	s.mu.Lock()
	running := s.running
	s.mu.Unlock()
	return running
}
76233
func (list packetList) isComplete() (bool, int) {
	numPackets := len(list)

	// Trivial cases

	switch numPackets {
	case 0:
		return false, 0
	case 1:
		return true, len(list[0].Payload)
	case 2:
		TCPHeader0, _ := tcpFromPcap(list[0])
		TCPHeader1, _ := tcpFromPcap(list[1])
		size0 := len(list[0].Payload)

		if TCPHeader0.Seq+uint32(size0) == TCPHeader1.Seq {
			return true, size0 + len(list[1].Payload)
		}

		return false, 0
	}

	// More than 2 packets -> loop

	TCPHeader, _ := tcpFromPcap(list[0])
	payloadSize := len(list[0].Payload)
	prevSeq := TCPHeader.Seq
	prevSize := len(list[0].Payload)

	for i := 1; i < numPackets; i++ {
		TCPHeader, _ = tcpFromPcap(list[i])
		if prevSeq+uint32(prevSize) != TCPHeader.Seq {
			return false, 0
		}

		prevSeq = TCPHeader.Seq
		prevSize = len(list[i].Payload)
		payloadSize += prevSize
	}

	return true, payloadSize
}
82786
func (r *Consumer) IsStarved() bool {
	for _, conn := range r.conns() {
		threshold := int64(float64(conn.RDY()) * 0.85)
		inFlight := atomic.LoadInt64(&conn.messagesInFlight)
		if inFlight >= threshold && inFlight > 0 && !conn.IsClosing() {
			return true
		}
	}
	return false
}
75136
func (a *Automaton) IsAccept(state int) bool {
	return a.isAccept.Get(int64(state))
}
822129
func (hri *HealResultItem) GetMissingCounts() (b, a int) {
	if hri == nil {
		return
	}
	for _, v := range hri.Before.Drives {
		if v.State == DriveStateMissing {
			b++
		}
	}
	for _, v := range hri.After.Drives {
		if v.State == DriveStateMissing {
			a++
		}
	}
	return
}