Browse Source

Simplified AlmostVersion null check

pull/46/head
Anairkoen Schno 5 years ago
parent
commit
1ba1e99953
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      IPA.Loader/Utilities/AlmostVersion.cs

+ 2
- 2
IPA.Loader/Utilities/AlmostVersion.cs View File

@ -206,8 +206,8 @@ namespace IPA.Utilities
/// <seealso cref="Equals(object)"/> /// <seealso cref="Equals(object)"/>
public static bool operator==(AlmostVersion l, AlmostVersion r) public static bool operator==(AlmostVersion l, AlmostVersion r)
{ {
if (ReferenceEquals(l, null) && ReferenceEquals(r, null)) return true;
if (ReferenceEquals(l, null) || ReferenceEquals(r, null)) return false;
if (l is null && r is null) return true;
if (l is null || r is null) return false;
if (l.StorageMode != r.StorageMode) return false; if (l.StorageMode != r.StorageMode) return false;
if (l.StorageMode == StoredAs.SemVer) if (l.StorageMode == StoredAs.SemVer)
return Utils.VersionCompareNoPrerelease(l.SemverValue, r.SemverValue) == 0; return Utils.VersionCompareNoPrerelease(l.SemverValue, r.SemverValue) == 0;


Loading…
Cancel
Save