minor optimization: compare if a song is in ranking for UpdateCourseStats if ranking is chosen in prefs
This commit is contained in:
@@ -922,13 +922,17 @@ void Course::UpdateCourseStats()
|
|||||||
SortOrder_TotalDifficulty = 999999; // large number
|
SortOrder_TotalDifficulty = 999999; // large number
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SortOrder_TotalDifficulty += ci[i].pNotes->GetMeter();
|
SortOrder_TotalDifficulty += ci[i].pNotes->GetMeter();
|
||||||
}
|
}
|
||||||
|
|
||||||
SortOrder_AvgDifficulty = (float)SortOrder_TotalDifficulty/GetEstimatedNumStages();
|
SortOrder_AvgDifficulty = (float)SortOrder_TotalDifficulty/GetEstimatedNumStages();
|
||||||
if (GetEstimatedNumStages() > 7) SortOrder_Ranking = 3;
|
if (GetEstimatedNumStages() > 7) SortOrder_Ranking = 3;
|
||||||
|
|
||||||
|
// HACK: this function takes a while to execute because of
|
||||||
|
// the ranking portion at the end. Do so only if it is
|
||||||
|
// absolutely necessary.
|
||||||
|
if (PREFSMAN->m_iCourseSortOrder == PrefsManager::COURSE_SORT_RANK)
|
||||||
|
{
|
||||||
CStringArray RankingCourses;
|
CStringArray RankingCourses;
|
||||||
|
|
||||||
split( THEME->GetMetric("ScreenRanking","CoursesToShow"),",", RankingCourses);
|
split( THEME->GetMetric("ScreenRanking","CoursesToShow"),",", RankingCourses);
|
||||||
@@ -936,5 +940,6 @@ void Course::UpdateCourseStats()
|
|||||||
for(i = 0; i < RankingCourses.size(); i++)
|
for(i = 0; i < RankingCourses.size(); i++)
|
||||||
if (!RankingCourses[i].CompareNoCase(this->m_sPath))
|
if (!RankingCourses[i].CompareNoCase(this->m_sPath))
|
||||||
SortOrder_Ranking = 1;
|
SortOrder_Ranking = 1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user