diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-07-26 02:50:20 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-07-26 02:50:20 -0400 |
commit | 7900a84bd68d7c9450bba719ce925b61043875f3 (patch) | |
tree | 8c495b7fe1c29c0cb552dc657a7a8b61185be0bd /src/SMAPI.Web | |
parent | ee4c88f6016b6bc0d72e0d459f6b918bdd7728f3 (diff) | |
download | SMAPI-7900a84bd68d7c9450bba719ce925b61043875f3.tar.gz SMAPI-7900a84bd68d7c9450bba719ce925b61043875f3.tar.bz2 SMAPI-7900a84bd68d7c9450bba719ce925b61043875f3.zip |
use ordinal comparison/sorting instead of invariant
Diffstat (limited to 'src/SMAPI.Web')
4 files changed, 7 insertions, 7 deletions
diff --git a/src/SMAPI.Web/Controllers/JsonValidatorController.cs b/src/SMAPI.Web/Controllers/JsonValidatorController.cs index 5f83eafd..6ba97749 100644 --- a/src/SMAPI.Web/Controllers/JsonValidatorController.cs +++ b/src/SMAPI.Web/Controllers/JsonValidatorController.cs @@ -280,7 +280,7 @@ namespace StardewModdingAPI.Web.Controllers IDictionary<string, string> errors = this.GetExtensionField<Dictionary<string, string>>(error.Schema, "@errorMessages"); if (errors == null) return null; - errors = new Dictionary<string, string>(errors, StringComparer.InvariantCultureIgnoreCase); + errors = new Dictionary<string, string>(errors, StringComparer.OrdinalIgnoreCase); // match error by type and message foreach ((string target, string errorMessage) in errors) @@ -289,7 +289,7 @@ namespace StardewModdingAPI.Web.Controllers continue; string[] parts = target.Split(':', 2); - if (parts[0].Equals(error.ErrorType.ToString(), StringComparison.InvariantCultureIgnoreCase) && Regex.IsMatch(error.Message, parts[1])) + if (parts[0].Equals(error.ErrorType.ToString(), StringComparison.OrdinalIgnoreCase) && Regex.IsMatch(error.Message, parts[1])) return errorMessage?.Trim(); } @@ -313,7 +313,7 @@ namespace StardewModdingAPI.Web.Controllers { foreach ((string curKey, JToken value) in schema.ExtensionData) { - if (curKey.Equals(key, StringComparison.InvariantCultureIgnoreCase)) + if (curKey.Equals(key, StringComparison.OrdinalIgnoreCase)) return value.ToObject<T>(); } } diff --git a/src/SMAPI.Web/Controllers/ModsApiController.cs b/src/SMAPI.Web/Controllers/ModsApiController.cs index db669bf9..cd5b6779 100644 --- a/src/SMAPI.Web/Controllers/ModsApiController.cs +++ b/src/SMAPI.Web/Controllers/ModsApiController.cs @@ -118,9 +118,9 @@ namespace StardewModdingAPI.Web.Controllers { // cross-reference data ModDataRecord record = this.ModDatabase.Get(search.ID); - WikiModEntry wikiEntry = wikiData.FirstOrDefault(entry => entry.ID.Contains(search.ID.Trim(), StringComparer.InvariantCultureIgnoreCase)); + WikiModEntry wikiEntry = wikiData.FirstOrDefault(entry => entry.ID.Contains(search.ID.Trim(), StringComparer.OrdinalIgnoreCase)); UpdateKey[] updateKeys = this.GetUpdateKeys(search.UpdateKeys, record, wikiEntry).ToArray(); - ModOverrideConfig overrides = this.Config.Value.ModOverrides.FirstOrDefault(p => p.ID.Equals(search.ID?.Trim(), StringComparison.InvariantCultureIgnoreCase)); + ModOverrideConfig overrides = this.Config.Value.ModOverrides.FirstOrDefault(p => p.ID.Equals(search.ID?.Trim(), StringComparison.OrdinalIgnoreCase)); bool allowNonStandardVersions = overrides?.AllowNonStandardVersions ?? false; // get latest versions diff --git a/src/SMAPI.Web/Framework/Caching/Mods/ModCacheMemoryRepository.cs b/src/SMAPI.Web/Framework/Caching/Mods/ModCacheMemoryRepository.cs index 6b0ec1ec..9769793c 100644 --- a/src/SMAPI.Web/Framework/Caching/Mods/ModCacheMemoryRepository.cs +++ b/src/SMAPI.Web/Framework/Caching/Mods/ModCacheMemoryRepository.cs @@ -13,7 +13,7 @@ namespace StardewModdingAPI.Web.Framework.Caching.Mods ** Fields *********/ /// <summary>The cached mod data indexed by <c>{site key}:{ID}</c>.</summary> - private readonly IDictionary<string, Cached<IModPage>> Mods = new Dictionary<string, Cached<IModPage>>(StringComparer.InvariantCultureIgnoreCase); + private readonly IDictionary<string, Cached<IModPage>> Mods = new Dictionary<string, Cached<IModPage>>(StringComparer.OrdinalIgnoreCase); /********* diff --git a/src/SMAPI.Web/Framework/Clients/GitHub/GitHubClient.cs b/src/SMAPI.Web/Framework/Clients/GitHub/GitHubClient.cs index 2f1eb854..671f077c 100644 --- a/src/SMAPI.Web/Framework/Clients/GitHub/GitHubClient.cs +++ b/src/SMAPI.Web/Framework/Clients/GitHub/GitHubClient.cs @@ -150,7 +150,7 @@ namespace StardewModdingAPI.Web.Framework.Clients.GitHub /// <exception cref="ArgumentException">The repository key is invalid.</exception> private void AssertKeyFormat(string repo) { - if (repo == null || !repo.Contains("/") || repo.IndexOf("/", StringComparison.InvariantCultureIgnoreCase) != repo.LastIndexOf("/", StringComparison.InvariantCultureIgnoreCase)) + if (repo == null || !repo.Contains("/") || repo.IndexOf("/", StringComparison.OrdinalIgnoreCase) != repo.LastIndexOf("/", StringComparison.OrdinalIgnoreCase)) throw new ArgumentException($"The value '{repo}' isn't a valid GitHub repository key, must be a username and project name like 'Pathoschild/SMAPI'.", nameof(repo)); } } |