From 768ec1504fba54354dede9016cfb64fbafc4890a Mon Sep 17 00:00:00 2001 From: lixiangwuxian Date: Sat, 12 Apr 2025 21:32:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E5=88=86=E6=95=B0=E7=9A=84=E5=BE=AA=E7=8E=AF?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A1=AE=E4=BF=9D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E5=A4=84=E7=90=86=E8=AE=B0=E5=BD=95=E6=95=B0=E9=87=8F=E5=B9=B6?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E8=B6=8A=E7=95=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/scoresaber/bind_ss.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/scoresaber/bind_ss.go b/service/scoresaber/bind_ss.go index 13c994c..26155cf 100644 --- a/service/scoresaber/bind_ss.go +++ b/service/scoresaber/bind_ss.go @@ -338,7 +338,7 @@ func (ss *ssQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er } `json:"playerScores"` } records := make([]RecordDataLite, 0) - for i := 0; i < count/8; i++ { + for i := range (count-1)/8 + 1 { fullUrl := fmt.Sprintf(historyUrl, ssId, i+1) resp, err := http.Get(fullUrl) if err != nil { @@ -354,8 +354,8 @@ func (ss *ssQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er return nil, err } scores := response.Data - for k, score := range scores { - if k > count-1 { + for _, score := range scores { + if len(records) > count { break } record := RecordDataLite{