Skip to content

Commit 28000ff

Browse files
authored
Merge pull request #1352 from dotnet/dev/bartde/rx_nullable_step13
Enable #nullable for a few more scheduler types.
2 parents b4f934d + 3052090 commit 28000ff

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

Rx.NET/Source/src/System.Reactive/Platforms/Desktop/Concurrency/ControlScheduler.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT License.
3-
// See the LICENSE file in the project root for more information.
4-
5-
#nullable disable
3+
// See the LICENSE file in the project root for more information.
64

75
using System.Reactive.Disposables;
86
using System.Threading;
@@ -33,10 +31,7 @@ public ControlScheduler(Control control)
3331
/// <summary>
3432
/// Gets the control associated with the ControlScheduler.
3533
/// </summary>
36-
public Control Control
37-
{
38-
get { return _control; }
39-
}
34+
public Control Control => _control;
4035

4136
/// <summary>
4237
/// Schedules an action to be executed on the message loop associated with the control.
@@ -114,7 +109,7 @@ public override IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Fun
114109
finally
115110
{
116111
t.Stop();
117-
action = null;
112+
action = static (s, t) => Disposable.Empty;
118113
}
119114
}
120115
};

Rx.NET/Source/src/System.Reactive/Platforms/Desktop/Concurrency/DispatcherScheduler.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT License.
33
// See the LICENSE file in the project root for more information.
44

5-
#nullable disable
6-
75
#if HAS_WPF
86
using System.Reactive.Disposables;
97
using System.Threading;
@@ -149,7 +147,7 @@ private IDisposable ScheduleSlow<TState>(TState state, TimeSpan dueTime, Func<IS
149147
finally
150148
{
151149
t.Stop();
152-
action = null;
150+
action = static (s, t) => Disposable.Empty;
153151
}
154152
}
155153
};

Rx.NET/Source/src/System.Reactive/Platforms/UWP/Concurrency/CoreDispatcherScheduler.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT License.
33
// See the LICENSE file in the project root for more information.
44

5-
#nullable disable
6-
75
#if WINDOWS
86
using System.Reactive.Disposables;
97
using System.Runtime.ExceptionServices;
@@ -200,7 +198,7 @@ private IDisposable ScheduleSlow<TState>(TState state, TimeSpan dueTime, Func<IS
200198
finally
201199
{
202200
t.Stop();
203-
action = null;
201+
action = static (s, t) => Disposable.Empty;
204202
}
205203
}
206204
};

0 commit comments

Comments
 (0)