summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ContentManagers
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/ContentManagers')
-rw-r--r--src/SMAPI/Framework/ContentManagers/BaseContentManager.cs6
-rw-r--r--src/SMAPI/Framework/ContentManagers/GameContentManager.cs4
-rw-r--r--src/SMAPI/Framework/ContentManagers/ModContentManager.cs2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs
index 36f2f650..a8de013a 100644
--- a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs
+++ b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs
@@ -87,7 +87,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
this.IsNamespaced = isNamespaced;
// get asset data
- this.LanguageCodes = this.GetKeyLocales().ToDictionary(p => p.Value, p => p.Key, StringComparer.InvariantCultureIgnoreCase);
+ this.LanguageCodes = this.GetKeyLocales().ToDictionary(p => p.Value, p => p.Key, StringComparer.OrdinalIgnoreCase);
this.BaseDisposableReferences = reflection.GetField<List<IDisposable>>(this, "disposableAssets").GetValue();
}
@@ -192,7 +192,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
/// <returns>Returns the invalidated asset names and instances.</returns>
public IDictionary<string, object> InvalidateCache(Func<string, Type, bool> predicate, bool dispose = false)
{
- IDictionary<string, object> removeAssets = new Dictionary<string, object>(StringComparer.InvariantCultureIgnoreCase);
+ IDictionary<string, object> removeAssets = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
this.Cache.Remove((key, asset) =>
{
this.ParseCacheKey(key, out string assetName, out _);
@@ -295,7 +295,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
// handle localized key
if (!string.IsNullOrWhiteSpace(cacheKey))
{
- int lastSepIndex = cacheKey.LastIndexOf(".", StringComparison.InvariantCulture);
+ int lastSepIndex = cacheKey.LastIndexOf(".", StringComparison.Ordinal);
if (lastSepIndex >= 0)
{
string suffix = cacheKey.Substring(lastSepIndex + 1, cacheKey.Length - lastSepIndex - 1);
diff --git a/src/SMAPI/Framework/ContentManagers/GameContentManager.cs b/src/SMAPI/Framework/ContentManagers/GameContentManager.cs
index eaaf0e6f..f20580e1 100644
--- a/src/SMAPI/Framework/ContentManagers/GameContentManager.cs
+++ b/src/SMAPI/Framework/ContentManagers/GameContentManager.cs
@@ -123,7 +123,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
base.OnLocaleChanged();
// find assets for which a translatable version was loaded
- HashSet<string> removeAssetNames = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
+ HashSet<string> removeAssetNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (string key in this.IsLocalizableLookup.Where(p => p.Value).Select(p => p.Key))
removeAssetNames.Add(this.TryParseExplicitLanguageAssetKey(key, out string assetName, out _) ? assetName : key);
@@ -134,7 +134,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
|| (this.TryParseExplicitLanguageAssetKey(key, out string assetName, out _) && removeAssetNames.Contains(assetName))
)
.Select(p => p.Key)
- .OrderBy(p => p, StringComparer.InvariantCultureIgnoreCase)
+ .OrderBy(p => p, StringComparer.OrdinalIgnoreCase)
.ToArray();
if (invalidated.Any())
this.Monitor.Log($"Invalidated {invalidated.Length} asset names: {string.Join(", ", invalidated)} for locale change.", LogLevel.Trace);
diff --git a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
index cfda55b9..26ddb067 100644
--- a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
+++ b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
@@ -372,7 +372,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
break;
}
}
- if (contentKey.EndsWith(".png", StringComparison.InvariantCultureIgnoreCase))
+ if (contentKey.EndsWith(".png", StringComparison.OrdinalIgnoreCase))
contentKey = contentKey.Substring(0, contentKey.Length - 4);
try