summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/GameVersion.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/GameVersion.cs')
-rw-r--r--src/SMAPI/Framework/GameVersion.cs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/SMAPI/Framework/GameVersion.cs b/src/SMAPI/Framework/GameVersion.cs
index aa91d8f3..542c1345 100644
--- a/src/SMAPI/Framework/GameVersion.cs
+++ b/src/SMAPI/Framework/GameVersion.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
using System;
using System.Collections.Generic;
@@ -55,7 +53,7 @@ namespace StardewModdingAPI.Framework
private static string GetSemanticVersionString(string gameVersion)
{
// mapped version
- return GameVersion.VersionMap.TryGetValue(gameVersion, out string semanticVersion)
+ return GameVersion.VersionMap.TryGetValue(gameVersion, out string? semanticVersion)
? semanticVersion
: gameVersion;
}
@@ -64,10 +62,10 @@ namespace StardewModdingAPI.Framework
/// <param name="semanticVersion">The semantic version string.</param>
private static string GetGameVersionString(string semanticVersion)
{
- foreach (var mapping in GameVersion.VersionMap)
+ foreach ((string gameVersion, string equivalentSemanticVersion) in GameVersion.VersionMap)
{
- if (mapping.Value.Equals(semanticVersion, StringComparison.OrdinalIgnoreCase))
- return mapping.Key;
+ if (equivalentSemanticVersion.Equals(semanticVersion, StringComparison.OrdinalIgnoreCase))
+ return gameVersion;
}
return semanticVersion;