Skip to content

Commit 3af7277

Browse files
authored
Merge pull request #740 from danielcweber/RemoveRedundanciesInSymbolDeclarations
Remove redundancies in symbol declarations
2 parents 926867b + b6b6380 commit 3af7277

File tree

17 files changed

+24
-55
lines changed

17 files changed

+24
-55
lines changed

Rx.NET/Source/Directory.build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
</PropertyGroup>
2626

2727
<ItemGroup Condition="'$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false'">
28+
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.1" />
2829
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-62925-02" PrivateAssets="All"/>
2930
</ItemGroup>
3031

Rx.NET/Source/src/System.Reactive/Concurrency/HistoricalScheduler.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ public class HistoricalScheduler : HistoricalSchedulerBase
7575
/// Creates a new historical scheduler with the minimum value of <see cref="DateTimeOffset"/> as the initial clock value.
7676
/// </summary>
7777
public HistoricalScheduler()
78-
: base()
7978
{
8079
}
8180

Rx.NET/Source/src/System.Reactive/Concurrency/LocalScheduler.TimerQueue.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,16 +333,15 @@ private static void UpdateLongTermProcessingTimer()
333333
var dueCapped = TimeSpan.FromTicks(Math.Min(dueEarly.Ticks, MAXSUPPORTEDTIMER.Ticks));
334334

335335
_nextLongTermWorkItem = next;
336-
_nextLongTermTimer.Disposable = ConcurrencyAbstractionLayer.Current.StartTimer(_ => EvaluateLongTermQueue(_), null, dueCapped);
336+
_nextLongTermTimer.Disposable = ConcurrencyAbstractionLayer.Current.StartTimer(_ => EvaluateLongTermQueue(), null, dueCapped);
337337
}
338338
}
339339

340340
/// <summary>
341341
/// Evaluates the long term queue, transitioning short term work to the short term list,
342342
/// and adjusting the new long term processing timer accordingly.
343343
/// </summary>
344-
/// <param name="state">Ignored.</param>
345-
private static void EvaluateLongTermQueue(object state)
344+
private static void EvaluateLongTermQueue()
346345
{
347346
lock (_staticGate)
348347
{
@@ -408,7 +407,7 @@ internal void SystemClockChanged(object sender, SystemClockChangedEventArgs args
408407
// method to create a new timer for the new first long term item.
409408
//
410409
_nextLongTermWorkItem = null;
411-
EvaluateLongTermQueue(null);
410+
EvaluateLongTermQueue();
412411
}
413412
}
414413
}

Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Recursive.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ private static IDisposable InvokeRec3<TState>(IScheduler scheduler, (TState stat
171171
return recursiveInvoker;
172172
}
173173

174-
private abstract class InvokeRecBaseState<TState> : IDisposable
174+
private abstract class InvokeRecBaseState : IDisposable
175175
{
176176
protected readonly IScheduler Scheduler;
177177

@@ -190,7 +190,7 @@ public void Dispose()
190190

191191
}
192192

193-
private sealed class InvokeRec1State<TState> : InvokeRecBaseState<TState>
193+
private sealed class InvokeRec1State<TState> : InvokeRecBaseState
194194
{
195195
private readonly Action<TState, Action<TState>> _action;
196196
private readonly Action<TState> _recurseCallback;
@@ -219,7 +219,7 @@ internal void InvokeFirst(TState state)
219219
}
220220
}
221221

222-
private sealed class InvokeRec2State<TState> : InvokeRecBaseState<TState>
222+
private sealed class InvokeRec2State<TState> : InvokeRecBaseState
223223
{
224224
private readonly Action<TState, Action<TState, TimeSpan>> _action;
225225
private readonly Action<TState, TimeSpan> _recurseCallback;
@@ -247,7 +247,7 @@ internal void InvokeFirst(TState state)
247247
}
248248
}
249249

250-
private sealed class InvokeRec3State<TState> : InvokeRecBaseState<TState>
250+
private sealed class InvokeRec3State<TState> : InvokeRecBaseState
251251
{
252252
private readonly Action<TState, Action<TState, DateTimeOffset>> _action;
253253
private readonly Action<TState, DateTimeOffset> _recurseCallback;

Rx.NET/Source/src/System.Reactive/Concurrency/VirtualTimeScheduler.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,6 @@ public abstract class VirtualTimeScheduler<TAbsolute, TRelative> : VirtualTimeSc
363363
/// Creates a new virtual time scheduler with the default value of TAbsolute as the initial clock value.
364364
/// </summary>
365365
protected VirtualTimeScheduler()
366-
: base()
367366
{
368367
}
369368

Rx.NET/Source/src/System.Reactive/Internal/ScheduledObserver.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,8 @@ private void Dispatch(ICancelable cancel)
100100
}
101101
catch
102102
{
103-
var nop = default(T);
104-
while (_queue.TryDequeue(out nop))
103+
while (_queue.TryDequeue(out _))
105104
{
106-
;
107105
}
108106

109107
throw;
@@ -287,10 +285,8 @@ private void Run(object state, Action<object> recurse)
287285
{
288286
Interlocked.Exchange(ref _state, FAULTED);
289287

290-
var nop = default(T);
291-
while (_queue.TryDequeue(out nop))
288+
while (_queue.TryDequeue(out _))
292289
{
293-
;
294290
}
295291

296292
throw;

Rx.NET/Source/src/System.Reactive/Internal/SystemClock.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private static void CollectHandlers()
123123

124124
foreach (var handler in _systemClockChanged)
125125
{
126-
if (!handler.TryGetTarget(out var scheduler))
126+
if (!handler.TryGetTarget(out _))
127127
{
128128
if (remove == null)
129129
{

Rx.NET/Source/src/System.Reactive/Linq/Observable.Creation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ public static IObservable<TResult> Never<TResult>(TResult witness)
407407
/// <exception cref="ArgumentOutOfRangeException"><paramref name="count"/> is less than zero. -or- <paramref name="start"/> + <paramref name="count"/> - 1 is larger than <see cref="int.MaxValue"/>.</exception>
408408
public static IObservable<int> Range(int start, int count)
409409
{
410-
var max = ((long)start) + count - 1;
410+
var max = (long)start + count - 1;
411411
if (count < 0 || max > int.MaxValue)
412412
{
413413
throw new ArgumentOutOfRangeException(nameof(count));
@@ -427,7 +427,7 @@ public static IObservable<int> Range(int start, int count)
427427
/// <exception cref="ArgumentNullException"><paramref name="scheduler"/> is null.</exception>
428428
public static IObservable<int> Range(int start, int count, IScheduler scheduler)
429429
{
430-
var max = ((long)start) + count - 1;
430+
var max = (long)start + count - 1;
431431
if (count < 0 || max > int.MaxValue)
432432
{
433433
throw new ArgumentOutOfRangeException(nameof(count));

Rx.NET/Source/src/System.Reactive/Linq/Observable/FirstLastBlocking.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ public virtual void OnError(Exception error)
5252

5353
internal sealed class FirstBlocking<T> : BaseBlocking<T>
5454
{
55-
internal FirstBlocking() : base() { }
56-
5755
public override void OnCompleted()
5856
{
5957
Unblock();
@@ -86,8 +84,6 @@ public override void OnNext(T value)
8684

8785
internal sealed class LastBlocking<T> : BaseBlocking<T>
8886
{
89-
internal LastBlocking() : base() { }
90-
9187
public override void OnCompleted()
9288
{
9389
Unblock();

Rx.NET/Source/src/System.Reactive/Linq/Observable/GroupByUntil.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ public TValue GetOrAdd(TKey key, Func<TValue> valueFactory, out bool added)
350350

351351
public bool Remove(TKey key)
352352
{
353-
return _map.TryRemove(key, out var value);
353+
return _map.TryRemove(key, out _);
354354
}
355355
}
356356
}

0 commit comments

Comments
 (0)