diff --git a/handler/scoresaber/bs30.go b/handler/scoresaber/bs30.go index b0e688a..7cec0fa 100644 --- a/handler/scoresaber/bs30.go +++ b/handler/scoresaber/bs30.go @@ -630,7 +630,8 @@ func getRecent10Scores(playerID string) ([]ScoreSaberPlayerScore, error) { // 获取玩家的所有分数并转换为 SongData func getAllScoreSaberScores(playerID string) ([]SongData, error) { - var allSongs []SongData + // var allSongs []SongData + allSongs := make([]SongData, 40) cwd, _ := os.Getwd() // 获取Best30 @@ -669,7 +670,7 @@ func getAllScoreSaberScores(playerID string) ([]SongData, error) { defer util.ReportPanicToDev() defer wgAll.Done() wg := sync.WaitGroup{} - for _, score := range recentScores { + for i, score := range recentScores { wg.Add(1) go func() { defer util.ReportPanicToDev() @@ -680,7 +681,7 @@ func getAllScoreSaberScores(playerID string) ([]SongData, error) { return } songData.IsBest30 = false - allSongs = append(allSongs, songData) + allSongs[i+30] = songData }() wg.Wait() }