summaryrefslogtreecommitdiff
path: root/src/SMAPI.Toolkit
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-01-20 23:22:24 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-01-20 23:22:24 -0500
commit342fc80394ac2d1bd67fb1b745b8ddec927fac49 (patch)
tree8bfc33ebe6b0556a27eca0f16045e9a48fa67c99 /src/SMAPI.Toolkit
parent49666ac5bcfc0ffb2b8e2b8f2a274f90b67232d2 (diff)
downloadSMAPI-342fc80394ac2d1bd67fb1b745b8ddec927fac49.tar.gz
SMAPI-342fc80394ac2d1bd67fb1b745b8ddec927fac49.tar.bz2
SMAPI-342fc80394ac2d1bd67fb1b745b8ddec927fac49.zip
rewrite C# 9 code not supported in Linux build tools yet
Diffstat (limited to 'src/SMAPI.Toolkit')
-rw-r--r--src/SMAPI.Toolkit/SemanticVersion.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/SMAPI.Toolkit/SemanticVersion.cs b/src/SMAPI.Toolkit/SemanticVersion.cs
index d58dce0c..2f3e282b 100644
--- a/src/SMAPI.Toolkit/SemanticVersion.cs
+++ b/src/SMAPI.Toolkit/SemanticVersion.cs
@@ -293,12 +293,12 @@ namespace StardewModdingAPI.Toolkit
return string.Compare(this.ToString(), new SemanticVersion(otherMajor, otherMinor, otherPatch, otherPlatformRelease, otherTag).ToString(), StringComparison.OrdinalIgnoreCase);
}
- return CompareToRaw() switch
- {
- (< 0) => curOlder,
- (> 0) => curNewer,
- _ => same
- };
+ int result = CompareToRaw();
+ if (result < 0)
+ return curOlder;
+ if (result > 0)
+ return curNewer;
+ return same;
}
/// <summary>Assert that the current version is valid.</summary>