Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
QianMoXi committed Feb 28, 2024
1 parent 79aef11 commit 4c0325d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dnSpy/dnSpy.Contracts.Logic/Utilities/FrameworkPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ public FrameworkVersion(int major, int minor, int patch, string extra) {
Extra = extra;
}

///<inheritdoc/>
/// <inheritdoc/>
public override string ToString() {
if (Extra.Length == 0)
return $"{Major}.{Minor}.{Patch}";
return $"{Major}.{Minor}.{Patch}-{Extra}";
}

///<inheritdoc/>
/// <inheritdoc/>
public int CompareTo(FrameworkVersion other) {
int c = Major.CompareTo(other.Major);
if (c != 0)
Expand All @@ -223,17 +223,17 @@ static int CompareExtra(string a, string b) {
return StringComparer.Ordinal.Compare(a, b);
}

///<inheritdoc/>
/// <inheritdoc/>
public bool Equals(FrameworkVersion other) =>
Major == other.Major &&
Minor == other.Minor &&
Patch == other.Patch &&
StringComparer.Ordinal.Equals(Extra, other.Extra);

///<inheritdoc/>
/// <inheritdoc/>
public override bool Equals(object? obj) => obj is FrameworkVersion other && Equals(other);

///<inheritdoc/>
/// <inheritdoc/>
public override int GetHashCode() => Major ^ Minor ^ Patch ^ StringComparer.Ordinal.GetHashCode(Extra ?? string.Empty);
}
}

0 comments on commit 4c0325d

Please sign in to comment.