chore: cleanup some code (#1069)

* chore

* modernize loop

* ddns: simpify Provider struct
This commit is contained in:
UUBulb
2025-04-26 18:28:21 +08:00
committed by GitHub
parent 65f728e5b1
commit 4871211f93
8 changed files with 12 additions and 38 deletions

View File

@@ -187,7 +187,6 @@ func checkStatus() {
// 清理旧数据
if max > 0 && max < len(alertsStore[alert.ID][server.ID]) {
index := len(alertsStore[alert.ID][server.ID]) - max
clear(alertsStore[alert.ID][server.ID][:index]) // for GC
alertsStore[alert.ID][server.ID] = alertsStore[alert.ID][server.ID][index:]
}
}

View File

@@ -496,7 +496,6 @@ func (ss *ServiceSentinel) worker() {
log.Printf("NEZHA>> Failed to save service monitor metrics: %v", err)
}
clear(ss.serviceCurrentStatusData[mh.GetId()].result)
ss.serviceCurrentStatusData[mh.GetId()].result = ss.serviceCurrentStatusData[mh.GetId()].result[:0]
}