// CanRotate 判断文件是否到最大限制大小
359426
func (policy *SizeRotatePolicy) CanRotate(fileLogWriter *FileLogWriter) bool {
	return fileLogWriter.count > policy.maxBytes
}
1277399
func QuatRotate(angle float32, axis Vec3) Quat {
	// angle = (float32(math.Pi) * angle) / 180.0

	c, s := float32(math.Cos(float64(angle/2))), float32(math.Sin(float64(angle/2)))

	return Quat{c, axis.Mul(s)}
}
97537
func (vec *T) Rotate(angle float32) *T {
	*vec = vec.Rotated(angle)
	return vec
}
785594
func (writer *ConsoleWriter) SetRotateSize(rotateSize int64) {
	writer.lock.Lock()
	defer writer.lock.Unlock()

	return
}
819328
func (ep Endpoint) CanRelateTo(other Endpoint) bool {
	return ep.ApplicationName != other.ApplicationName &&
		ep.Interface == other.Interface &&
		ep.Role != charm.RolePeer &&
		counterpartRole(ep.Role) == other.Role
}
508228
func (self *RotatingFileHandler) RotateFile(sourceFile, destFile string) error {
	if FileExists(sourceFile) {
		if FileExists(destFile) {
			if err := os.Remove(destFile); err != nil {
				return err
			}
		}
		if err := os.Rename(sourceFile, destFile); err != nil {
			return err
		}
	}
	return nil
}
530017
func LogRotate(path string, MaxFileSize int, MaxBackupCount int) {
	//filter .log .trace files
	defer func() {
		if e := recover(); e != nil {
			Logger.Errorf("LogRotate catch an exception")
		}
	}()

	pat := `.(\.log|\.trace|\.out)$`
	fileList, err := FilterFileList(path, pat)
	if err != nil {
		Logger.Errorf("filepath.Walk() path: %s failed.", path)
		return
	}

	for _, file := range fileList {
		logRotateFile(file, MaxFileSize, MaxBackupCount)
	}
}
1100527
func (writer *MultiWriter) SetTimeRotated(timeRotated bool) {
	writer.timeRotated = timeRotated
	for _, fileWriter := range writer.writers {
		fileWriter.SetTimeRotated(timeRotated)
	}
}
123939
func (s *DescribeSecretOutput) SetRotationRules(v *RotationRulesType) *DescribeSecretOutput {
	s.RotationRules = v
	return s
}
1005032
func (s *Session) Invalidate() {
	s.G().Log.Debug("invalidating session")
	s.valid = false
	s.mtime = time.Time{}
	s.token = ""
	s.csrf = ""
	s.checked = false
}
173863
func CanAccess(path string, pair IDPair) bool {
	statInfo, err := system.Stat(path)
	if err != nil {
		return false
	}
	fileMode := os.FileMode(statInfo.Mode())
	permBits := fileMode.Perm()
	return accessible(statInfo.UID() == uint32(pair.UID),
		statInfo.GID() == uint32(pair.GID), permBits)
}
167791
func (rs *DailyRotationSchedule) ShouldRotate() (bool, string) {
	now := currentTime()
	if rs.rotateAfter == nil {
		nextRotate := dayOffset(now, 1)
		rs.rotateAfter = &nextRotate
		return false, ""
	}
	if now.After(*rs.rotateAfter) {
		// the suffix should be actually the date of the complete day being logged
		actualDay := dayOffset(*rs.rotateAfter, -1)
		suffix := "." + actualDay.Format("2006-01-02") // YYYY-MM-DD
		nextRotate := dayOffset(now, 1)
		rs.rotateAfter = &nextRotate
		return true, suffix
	}
	return false, ""
}
238457
func (c *CertAuthorityV2) GetRotation() Rotation {
	if c.Spec.Rotation == nil {
		return Rotation{}
	}
	return *c.Spec.Rotation
}
543161
func (vec *T) Rotated(angle float64) T {
	sinus := math.Sin(angle)
	cosinus := math.Cos(angle)
	return T{
		vec[0]*cosinus - vec[1]*sinus,
		vec[0]*sinus + vec[1]*cosinus,
	}
}
336856
func (f *File) CanDeleteFile(ctx context.Context, fi *dokan.FileInfo) error {
	f.folder.fs.logEnterf(ctx, "File CanDeleteFile for %q", f.name)
	return nil
}
459093
func (q *QueryFeedback) Invalidate() {
	q.Feedback = nil
	q.Hist = nil
	q.Valid = false
	q.actual = -1
}
606316
func symRotate(u Comparators, start1, start2, end int) {
	i := start2 - start1
	if i == 0 {
		return
	}

	j := end - start2
	if j == 0 {
		return
	}

	if i == j {
		symSwap(u, start1, start2, i)
		return
	}

	p := start1 + i
	for i != j {
		if i > j {
			symSwap(u, p-i, p, j)
			i -= j
		} else {
			symSwap(u, p-i, p+j-i, i)
			j -= i
		}
	}
	symSwap(u, p-i, p, i)
}