mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 18:23:04 +08:00
Add missing string function ordinal specifications
This commit is contained in:
parent
39a74536f2
commit
cc41845f56
@ -234,7 +234,7 @@ namespace osu.Game.Tournament.Screens.Drawings
|
|||||||
if (string.IsNullOrEmpty(line))
|
if (string.IsNullOrEmpty(line))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (line.ToUpperInvariant().StartsWith("GROUP"))
|
if (line.ToUpperInvariant().StartsWith("GROUP", StringComparison.Ordinal))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// ReSharper disable once AccessToModifiedClosure
|
// ReSharper disable once AccessToModifiedClosure
|
||||||
|
@ -92,7 +92,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
{
|
{
|
||||||
var pair = SplitKeyVal(line);
|
var pair = SplitKeyVal(line);
|
||||||
|
|
||||||
bool isCombo = pair.Key.StartsWith(@"Combo");
|
bool isCombo = pair.Key.StartsWith(@"Combo", StringComparison.Ordinal);
|
||||||
|
|
||||||
string[] split = pair.Value.Split(',');
|
string[] split = pair.Value.Split(',');
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ namespace osu.Game
|
|||||||
|
|
||||||
if (args?.Length > 0)
|
if (args?.Length > 0)
|
||||||
{
|
{
|
||||||
var paths = args.Where(a => !a.StartsWith(@"-")).ToArray();
|
var paths = args.Where(a => !a.StartsWith(@"-", StringComparison.Ordinal)).ToArray();
|
||||||
if (paths.Length > 0)
|
if (paths.Length > 0)
|
||||||
Task.Run(() => Import(paths));
|
Task.Run(() => Import(paths));
|
||||||
}
|
}
|
||||||
@ -289,7 +289,7 @@ namespace osu.Game
|
|||||||
|
|
||||||
public void OpenUrlExternally(string url) => waitForReady(() => externalLinkOpener, _ =>
|
public void OpenUrlExternally(string url) => waitForReady(() => externalLinkOpener, _ =>
|
||||||
{
|
{
|
||||||
if (url.StartsWith("/"))
|
if (url.StartsWith("/", StringComparison.Ordinal))
|
||||||
url = $"{API.Endpoint}{url}";
|
url = $"{API.Endpoint}{url}";
|
||||||
|
|
||||||
externalLinkOpener.OpenUrlExternally(url);
|
externalLinkOpener.OpenUrlExternally(url);
|
||||||
|
@ -100,7 +100,7 @@ namespace osu.Game.Rulesets
|
|||||||
{
|
{
|
||||||
// todo: StartsWith can be changed to Equals on 2020-11-08
|
// 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).
|
// This is to give users enough time to have their database use new abbreviated info).
|
||||||
if (context.RulesetInfo.FirstOrDefault(ri => ri.InstantiationInfo.StartsWith(r.RulesetInfo.InstantiationInfo)) == null)
|
if (context.RulesetInfo.FirstOrDefault(ri => ri.InstantiationInfo.StartsWith(r.RulesetInfo.InstantiationInfo, StringComparison.Ordinal)) == null)
|
||||||
context.RulesetInfo.Add(r.RulesetInfo);
|
context.RulesetInfo.Add(r.RulesetInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
@ -115,16 +116,16 @@ namespace osu.Game.Skinning
|
|||||||
currentConfig.MinimumColumnWidth = minWidth;
|
currentConfig.MinimumColumnWidth = minWidth;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case string _ when pair.Key.StartsWith("Colour"):
|
case string _ when pair.Key.StartsWith("Colour", StringComparison.Ordinal):
|
||||||
HandleColours(currentConfig, line);
|
HandleColours(currentConfig, line);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Custom sprite paths
|
// Custom sprite paths
|
||||||
case string _ when pair.Key.StartsWith("NoteImage"):
|
case string _ when pair.Key.StartsWith("NoteImage", StringComparison.Ordinal):
|
||||||
case string _ when pair.Key.StartsWith("KeyImage"):
|
case string _ when pair.Key.StartsWith("KeyImage", StringComparison.Ordinal):
|
||||||
case string _ when pair.Key.StartsWith("Hit"):
|
case string _ when pair.Key.StartsWith("Hit", StringComparison.Ordinal):
|
||||||
case string _ when pair.Key.StartsWith("Stage"):
|
case string _ when pair.Key.StartsWith("Stage", StringComparison.Ordinal):
|
||||||
case string _ when pair.Key.StartsWith("Lighting"):
|
case string _ when pair.Key.StartsWith("Lighting", StringComparison.Ordinal):
|
||||||
currentConfig.ImageLookups[pair.Key] = pair.Value;
|
currentConfig.ImageLookups[pair.Key] = pair.Value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ namespace osu.Game.Utils
|
|||||||
|
|
||||||
// since we let unhandled exceptions go ignored at times, we want to ensure they don't get submitted on subsequent reports.
|
// since we let unhandled exceptions go ignored at times, we want to ensure they don't get submitted on subsequent reports.
|
||||||
if (lastException != null &&
|
if (lastException != null &&
|
||||||
lastException.Message == exception.Message && exception.StackTrace.StartsWith(lastException.StackTrace))
|
lastException.Message == exception.Message && exception.StackTrace.StartsWith(lastException.StackTrace, StringComparison.Ordinal))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lastException = exception;
|
lastException = exception;
|
||||||
|
Loading…
Reference in New Issue
Block a user