Browse Source

Merge pull request #1325 from dotnet/dev/bartde/address_some_warnings

Address a few warnings.
Bart J.F. De Smet 5 years ago
parent
commit
8172a2306f

+ 2 - 2
Rx.NET/Source/src/Microsoft.Reactive.Testing/ReactiveAssert.cs

@@ -24,11 +24,11 @@ namespace Microsoft.Reactive.Testing
             sb.AppendLine();
             sb.Append("Expected: [");
             sb.Append(string.Join(", ", expected.Select(x => x.ToString()).ToArray()));
-            sb.Append("]");
+            sb.Append(']');
             sb.AppendLine();
             sb.Append("Actual..: [");
             sb.Append(string.Join(", ", actual.Select(x => x.ToString()).ToArray()));
-            sb.Append("]");
+            sb.Append(']');
             sb.AppendLine();
             return sb.ToString();
         }

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/EventLoopScheduler.cs

@@ -355,7 +355,7 @@ namespace System.Reactive.Concurrency
                             {
                                 item.Invoke();
                             }
-                            catch (ObjectDisposedException ex) when (nameof(EventLoopScheduler).Equals(ex.ObjectName))
+                            catch (ObjectDisposedException ex) when (ex.ObjectName == nameof(EventLoopScheduler))
                             {
                                 // Since we are not inside the lock at this point
                                 // the scheduler can be disposed before the item had a chance to run

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Creation.cs

@@ -384,7 +384,7 @@ namespace System.Reactive.Linq
             return Repeat_(value, scheduler);
         }
 
-        private IObservable<TResult> Repeat_<TResult>(TResult value, IScheduler scheduler)
+        private static IObservable<TResult> Repeat_<TResult>(TResult value, IScheduler scheduler)
         {
             var longRunning = scheduler.AsLongRunning();
             if (longRunning != null)
@@ -404,7 +404,7 @@ namespace System.Reactive.Linq
             return Repeat_(value, repeatCount, scheduler);
         }
 
-        private IObservable<TResult> Repeat_<TResult>(TResult value, int repeatCount, IScheduler scheduler)
+        private static IObservable<TResult> Repeat_<TResult>(TResult value, int repeatCount, IScheduler scheduler)
         {
             var longRunning = scheduler.AsLongRunning();
             if (longRunning != null)

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

@@ -156,7 +156,7 @@ namespace System.Reactive.Concurrency
         }
 
         /// <summary>
-        /// Schedules an action to be executed after <paramref name="dueTime"/> on the dispatcher, using a <see cref="DispatcherTimer"/> object.
+        /// Schedules an action to be executed after <paramref name="dueTime"/> on the dispatcher, using a <see cref="DispatcherQueueTimer"/> object.
         /// </summary>
         /// <typeparam name="TState">The type of the state passed to the scheduled action.</typeparam>
         /// <param name="state">State passed to the action to be executed.</param>
@@ -221,7 +221,7 @@ namespace System.Reactive.Concurrency
         }
 
         /// <summary>
-        /// Schedules a periodic piece of work on the dispatcher, using a <see cref="DispatcherTimer"/> object.
+        /// Schedules a periodic piece of work on the dispatcher, using a <see cref="DispatcherQueueTimer"/> object.
         /// </summary>
         /// <typeparam name="TState">The type of the state passed to the scheduled action.</typeparam>
         /// <param name="state">Initial state passed to the action upon the first iteration.</param>

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Subjects/AsyncSubject.cs

@@ -322,7 +322,7 @@ namespace System.Reactive.Subjects
 
         #region IDisposable implementation
 
-        private void ThrowDisposed()
+        private static void ThrowDisposed()
         {
             throw new ObjectDisposedException(string.Empty);
         }