Skip to content

Commit

Permalink
Naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Aug 8, 2023
1 parent b3d68a4 commit 8efbb78
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Qowaiv/Sustainability/EnergyLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,19 @@ private char Char(bool toLower)
public static explicit operator EnergyLabel(string str) => Parse(str, CultureInfo.CurrentCulture);

/// <summary>Returns true if the left operator is less then the right operator, otherwise false.</summary>
public static bool operator <(EnergyLabel l, EnergyLabel r) => NotUnknown(l, r) && l.CompareTo(r) < 0;
public static bool operator <(EnergyLabel l, EnergyLabel r) => AreKnown(l, r) && l.CompareTo(r) < 0;

/// <summary>Returns true if the left operator is greater then the right operator, otherwise false.</summary>
public static bool operator >(EnergyLabel l, EnergyLabel r) => NotUnknown(l, r) && l.CompareTo(r) > 0;
public static bool operator >(EnergyLabel l, EnergyLabel r) => AreKnown(l, r) && l.CompareTo(r) > 0;

/// <summary>Returns true if the left operator is less then or equal the right operator, otherwise false.</summary>
public static bool operator <=(EnergyLabel l, EnergyLabel r) => NotUnknown(l, r) && l.CompareTo(r) <= 0;
public static bool operator <=(EnergyLabel l, EnergyLabel r) => AreKnown(l, r) && l.CompareTo(r) <= 0;

/// <summary>Returns true if the left operator is greater then or equal the right operator, otherwise false.</summary>
public static bool operator >=(EnergyLabel l, EnergyLabel r) => NotUnknown(l, r) && l.CompareTo(r) >= 0;
public static bool operator >=(EnergyLabel l, EnergyLabel r) => AreKnown(l, r) && l.CompareTo(r) >= 0;

[Pure]
private static bool NotUnknown(EnergyLabel l, EnergyLabel r) => !l.IsUnknown() && !r.IsUnknown();
private static bool AreKnown(EnergyLabel l, EnergyLabel r) => !l.IsUnknown() && !r.IsUnknown();

/// <summary>Converts the <see cref="string"/> to <see cref="EnergyLabel"/>.
/// A return value indicates whether the conversion succeeded.
Expand Down

0 comments on commit 8efbb78

Please sign in to comment.