mirror of
https://github.com/ppy/osu
synced 2025-01-01 03:42:19 +00:00
Replace with local tolist
This commit is contained in:
parent
81cc5e1c42
commit
6385d5f369
@ -96,12 +96,13 @@ namespace osu.Game.Rulesets
|
||||
context.SaveChanges();
|
||||
|
||||
// add any other modes
|
||||
var existingRulesets = context.RulesetInfo.ToList();
|
||||
|
||||
foreach (var r in instances.Where(r => !(r is ILegacyRuleset)))
|
||||
{
|
||||
// todo: StartsWith can be changed to Equals on 2020-11-08
|
||||
// This is to give users enough time to have their database use new abbreviated info).
|
||||
// ReSharper disable once StringStartsWithIsCultureSpecific (silences EF warning of ordinal being unsupported)
|
||||
if (context.RulesetInfo.FirstOrDefault(ri => ri.InstantiationInfo.StartsWith(r.RulesetInfo.InstantiationInfo)) == null)
|
||||
if (existingRulesets.FirstOrDefault(ri => ri.InstantiationInfo.StartsWith(r.RulesetInfo.InstantiationInfo, StringComparison.Ordinal)) == null)
|
||||
context.RulesetInfo.Add(r.RulesetInfo);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user