summaryrefslogtreecommitdiff
path: root/src/SMAPI.Toolkit
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-11-04 16:50:00 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-11-04 16:50:00 -0500
commit88dce820d52f7e09ce5424e13b34d6c10d5868ed (patch)
tree5a85bf951ebffa09215f0035ef3d6b5c4bf3f9d5 /src/SMAPI.Toolkit
parent01c612bc4aca5a1d8921432c94956f4d170d4d4b (diff)
downloadSMAPI-88dce820d52f7e09ce5424e13b34d6c10d5868ed.tar.gz
SMAPI-88dce820d52f7e09ce5424e13b34d6c10d5868ed.tar.bz2
SMAPI-88dce820d52f7e09ce5424e13b34d6c10d5868ed.zip
no longer omit zero patch numbers when formatting versions
Diffstat (limited to 'src/SMAPI.Toolkit')
-rw-r--r--src/SMAPI.Toolkit/SemanticVersion.cs14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/SMAPI.Toolkit/SemanticVersion.cs b/src/SMAPI.Toolkit/SemanticVersion.cs
index 6d5d65ac..2ce3578e 100644
--- a/src/SMAPI.Toolkit/SemanticVersion.cs
+++ b/src/SMAPI.Toolkit/SemanticVersion.cs
@@ -172,16 +172,10 @@ namespace StardewModdingAPI.Toolkit
/// <summary>Get a string representation of the version.</summary>
public override string ToString()
{
- // version
- string result = this.PatchVersion != 0
- ? $"{this.MajorVersion}.{this.MinorVersion}.{this.PatchVersion}"
- : $"{this.MajorVersion}.{this.MinorVersion}";
-
- // tag
- string tag = this.PrereleaseTag;
- if (tag != null)
- result += $"-{tag}";
- return result;
+ string version = $"{this.MajorVersion}.{this.MinorVersion}.{this.PatchVersion}";
+ if (this.PrereleaseTag != null)
+ version += $"-{this.PrereleaseTag}";
+ return version;
}
/// <summary>Parse a version string without throwing an exception if it fails.</summary>