fix: 修复 getAllScoreSaberScores 函数中的 allSongs 初始化方式,确保正确创建 SongData 切片
This commit is contained in:
parent
bffb3b8975
commit
e32f4c13fe
@ -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()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user