Skip to content
This repository was archived by the owner on Nov 14, 2025. It is now read-only.

Commit b666afb

Browse files
Refactor ConversionAdd to expression-bodied member
Simplified the `ConversionAdd` method by converting it from a block body to an expression body. Removed the explicit null check for the `other` parameter, potentially relying on other mechanisms to ensure `other` is not null. The method now directly returns the result of `Create(Quantity + other)`.
1 parent 968d7cb commit b666afb

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

PhysicalQuantity/Quantities/PhysicalQuantity.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,7 @@ public TSelf Clamp<T1, T2>(T1 min, T2 max)
6363
where T2 : INumber<T2>
6464
=> Create(Quantity.Clamp(min.ToSignificantNumber(), max.ToSignificantNumber()));
6565

66-
protected TSelf ConversionAdd(SignificantNumber other)
67-
{
68-
ArgumentNullException.ThrowIfNull(other);
69-
70-
return Create(Quantity + other);
71-
}
66+
protected TSelf ConversionAdd(SignificantNumber other) => Create(Quantity + other);
7267
}
7368

7469
/// <summary>

0 commit comments

Comments
 (0)