* Improve performance of DateTime.Kind.
* Remove the unused field.
* Fixing whitespaces.
Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
* Revert the changes and add AgressiveInlining
* Put the attribute on the getter.
* Update src/libraries/System.Private.CoreLib/src/System/DateTime.cs
Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
internal bool IsAmbiguousDaylightSavingTime() =>
InternalKind == KindLocalAmbiguousDst;
- public DateTimeKind Kind =>
- InternalKind switch
+ public DateTimeKind Kind
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get => InternalKind switch
{
KindUnspecified => DateTimeKind.Unspecified,
KindUtc => DateTimeKind.Utc,
_ => DateTimeKind.Local,
};
+ }
// Returns the millisecond part of this DateTime. The returned value
// is an integer between 0 and 999.