Răsfoiți Sursa

Merge pull request #1543 from marodev/cosmetics/technical-debt

Refactors code to reduce technical debt
Bart J.F. De Smet 4 ani în urmă
părinte
comite
23e13e06dd

+ 1 - 4
AsyncRx.NET/System.Reactive.Async.Concurrency/System/Reactive/Concurrency/AsyncScheduler.cs

@@ -231,10 +231,7 @@ namespace System.Reactive.Concurrency
                         throw new InvalidOperationException(); // REVIEW: No support for blocking.
                     }
 
-                    if (_error != null)
-                    {
-                        _error.Throw();
-                    }
+                    _error?.Throw();
                 }
 
                 public void OnCompleted(Action continuation)

+ 1 - 4
Ix.NET/Source/System.Interactive/System/Linq/Operators/Publish.cs

@@ -191,10 +191,7 @@ namespace System.Linq
                 }
                 finally
                 {
-                    if (_buffer != null)
-                    {
-                        _buffer.Done(i + 1);
-                    }
+                    _buffer?.Done(i + 1);
                 }
             }
         }

+ 1 - 4
Ix.NET/Source/System.Linq.Async.Queryable/System/Linq/AsyncEnumerableRewriter.cs

@@ -291,10 +291,7 @@ namespace System.Linq
                         }
                     }
 
-                    if (list != null)
-                    {
-                        list.Add(expression);
-                    }
+                    list?.Add(expression);
                 }
 
                 //

+ 1 - 4
Ix.NET/Source/System.Linq.Async/System/Linq/Disposables.cs

@@ -47,10 +47,7 @@ namespace System.Linq
                 d1.Dispose();
 
                 var d2 = Interlocked.Exchange(ref _d2, null);
-                if (d2 != null)
-                {
-                    d2.Dispose();
-                }
+                d2?.Dispose();
             }
         }
     }