Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the constants in TimeSpan #103993

Merged
merged 1 commit into from
Jun 26, 2024
Merged

Commits on Jun 25, 2024

  1. Expose the constants in TimeSpan

    Publicly expose the useful constants that `TimeSpan` had internally declared since they're rooted in hard reality and not changeable, and quite useful elsewhere. Everything is a `long` except `HoursPerDay` because that is useful in many non-TimeSpan contexts and rarely would overflow.
    
    Added /// documentation for newly public constants and updated _System.Runtime.cs_ assembly API reference.
    
    Use the newly exposed values in all the runtime places similar constants are declared in runtime **EXCEPT** did not use the `TimeSpan` constant in _EventLogInternal.cs_ since that source is also built for older frameworks, leave existing internal constant.
    
    In _Calendar.cs_, use an `int` cast at the call-sites to `Add` method to prevent performance degradation, these calls are known not to overflow.
    
    Fixes dotnet#94545
    IDisposable committed Jun 25, 2024
    Configuration menu
    Copy the full SHA
    e189d46 View commit details
    Browse the repository at this point in the history