Skip to content

Commit cd58bcd

Browse files
committed
Refactored to nullable types and c# 8
1 parent a8a647b commit cd58bcd

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Simplify.System/TimeProvider.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#nullable disable
2-
3-
using System;
1+
using System;
42

53
namespace Simplify.System
64
{
@@ -9,7 +7,7 @@ namespace Simplify.System
97
/// </summary>
108
public static class TimeProvider
119
{
12-
private static ITimeProvider _currentInstance;
10+
private static ITimeProvider? _currentInstance;
1311

1412
/// <summary>
1513
/// Gets or sets the current time provider.
@@ -20,7 +18,7 @@ public static class TimeProvider
2018
/// <exception cref="ArgumentNullException">value</exception>
2119
public static ITimeProvider Current
2220
{
23-
get => _currentInstance ?? (_currentInstance = new SystemTimeProvider());
21+
get => _currentInstance ??= new SystemTimeProvider();
2422
set => _currentInstance = value ?? throw new ArgumentNullException(nameof(value));
2523
}
2624
}

0 commit comments

Comments
 (0)