Skip to content

Commit c7c0dfa

Browse files
committed
cleanup
1 parent 4cdc1ba commit c7c0dfa

File tree

120 files changed

+721
-1321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+721
-1321
lines changed

CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -863,12 +863,13 @@ public int CompareTo({_quantity.Name} other)
863863
public bool Equals({_quantity.Name} other, {_quantity.ValueType} tolerance, ComparisonType comparisonType)
864864
{{
865865
if (tolerance < 0)
866-
throw new ArgumentOutOfRangeException(""tolerance"", ""Tolerance must be greater than or equal to 0."");
866+
throw new ArgumentOutOfRangeException(nameof(tolerance), ""Tolerance must be greater than or equal to 0."");
867867
868-
{_quantity.ValueType} thisValue = this.Value;
869-
{_quantity.ValueType} otherValueInThisUnits = other.As(this.Unit);
870-
871-
return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType);
868+
return UnitsNet.Comparison.Equals(
869+
referenceValue: this.Value,
870+
otherValue: other.As(this.Unit),
871+
tolerance: tolerance,
872+
comparisonType: ComparisonType.Absolute);
872873
}}
873874
874875
/// <inheritdoc />
@@ -884,12 +885,6 @@ public bool Equals(IQuantity? other, IQuantity tolerance)
884885
/// <inheritdoc />
885886
public bool Equals({_quantity.Name} other, {_quantity.Name} tolerance)
886887
{{
887-
if (tolerance < Zero)
888-
throw new ArgumentOutOfRangeException(""tolerance"", ""Tolerance must be greater than or equal to 0."");
889-
890-
{_quantity.ValueType} thisValue = this.Value;
891-
{_quantity.ValueType} otherValueInThisUnits = other.As(this.Unit);
892-
893888
return UnitsNet.Comparison.Equals(
894889
referenceValue: this.Value,
895890
otherValue: other.As(this.Unit),

UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs

Lines changed: 7 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs

Lines changed: 6 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs

Lines changed: 6 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/Angle.g.cs

Lines changed: 6 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs

Lines changed: 6 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs

Lines changed: 6 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/Area.g.cs

Lines changed: 6 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs

Lines changed: 6 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs

Lines changed: 6 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)