Skip to content

Commit 52f410f

Browse files
Copilotniemyjski
andcommitted
Add XML documentation to SubtractSaturating method
Co-authored-by: niemyjski <[email protected]>
1 parent 10706ca commit 52f410f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Exceptionless.DateTimeExtensions/TimeSpanExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ public static AgeSpan ToAgeSpan(this TimeSpan span)
8989
return new AgeSpan(span);
9090
}
9191

92+
/// <summary>
93+
/// Subtracts the specified TimeSpan from this TimeSpan, ensuring the result never goes below TimeSpan.Zero.
94+
/// </summary>
95+
/// <param name="self">The TimeSpan to subtract from.</param>
96+
/// <param name="other">The TimeSpan to subtract.</param>
97+
/// <returns>The result of the subtraction, or TimeSpan.Zero if the result would be negative.</returns>
9298
public static TimeSpan SubtractSaturating(this TimeSpan self, TimeSpan other)
9399
{
94100
return self >= other ? self.Subtract(other) : TimeSpan.Zero;

0 commit comments

Comments
 (0)