mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Fix the MOTHERLOAD of undetected issues that are now visible thanks to net6.0
This commit is contained in:
@ -44,7 +44,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public override async Task<Live<BeatmapSetInfo>?> ImportAsUpdate(ProgressNotification notification, ImportTask importTask, BeatmapSetInfo original)
|
||||
{
|
||||
var imported = await Import(notification, importTask);
|
||||
var imported = await Import(notification, importTask).ConfigureAwait(false);
|
||||
|
||||
if (!imported.Any())
|
||||
return null;
|
||||
|
@ -178,7 +178,7 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
try
|
||||
{
|
||||
await cacheDownloadRequest.PerformAsync();
|
||||
await cacheDownloadRequest.PerformAsync().ConfigureAwait(false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
|
||||
public void AttachGroup(ControlPointGroup pointGroup) => Time = pointGroup.Time;
|
||||
|
||||
public int CompareTo(ControlPoint other) => Time.CompareTo(other.Time);
|
||||
public int CompareTo(ControlPoint? other) => Time.CompareTo(other?.Time);
|
||||
|
||||
public virtual Color4 GetRepresentingColour(OsuColour colours) => colours.Yellow;
|
||||
|
||||
@ -32,7 +32,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
/// </summary>
|
||||
public ControlPoint DeepClone()
|
||||
{
|
||||
var copy = (ControlPoint)Activator.CreateInstance(GetType());
|
||||
var copy = (ControlPoint)Activator.CreateInstance(GetType())!;
|
||||
|
||||
copy.CopyFrom(this);
|
||||
|
||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
Time = time;
|
||||
}
|
||||
|
||||
public int CompareTo(ControlPointGroup other) => Time.CompareTo(other.Time);
|
||||
public int CompareTo(ControlPointGroup? other) => Time.CompareTo(other?.Time);
|
||||
|
||||
public void Add(ControlPoint point)
|
||||
{
|
||||
|
@ -51,11 +51,11 @@ namespace osu.Game.Beatmaps
|
||||
if (!recommendedDifficultyMapping.TryGetValue(r, out double recommendation))
|
||||
continue;
|
||||
|
||||
BeatmapInfo beatmapInfo = beatmaps.Where(b => b.Ruleset.ShortName.Equals(r)).OrderBy(b =>
|
||||
BeatmapInfo beatmapInfo = beatmaps.Where(b => b.Ruleset.ShortName.Equals(r, StringComparison.Ordinal)).MinBy(b =>
|
||||
{
|
||||
double difference = b.StarRating - recommendation;
|
||||
return difference >= 0 ? difference * 2 : difference * -1; // prefer easier over harder
|
||||
}).FirstOrDefault();
|
||||
});
|
||||
|
||||
if (beatmapInfo != null)
|
||||
return beatmapInfo;
|
||||
@ -90,7 +90,7 @@ namespace osu.Game.Beatmaps
|
||||
return recommendedDifficultyMapping
|
||||
.OrderByDescending(pair => pair.Value)
|
||||
.Select(pair => pair.Key)
|
||||
.Where(r => !r.Equals(ruleset.Value.ShortName))
|
||||
.Where(r => !r.Equals(ruleset.Value.ShortName, StringComparison.Ordinal))
|
||||
.Prepend(ruleset.Value.ShortName);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user