Browse Source

Some code modernization.

Bart De Smet 8 years ago
parent
commit
930cfc6cd4
1 changed files with 3 additions and 12 deletions
  1. 3 12
      Ix.NET/Source/System.Interactive.Async/ToObservable.cs

+ 3 - 12
Ix.NET/Source/System.Interactive.Async/ToObservable.cs

@@ -116,10 +116,7 @@ namespace System.Linq
                     }
                 }
 
-                if (tcs != null)
-                {
-                    tcs.TrySetResult(false);
-                }
+                tcs?.TrySetResult(false);
             }
 
             public void OnError(Exception error)
@@ -137,10 +134,7 @@ namespace System.Linq
                     }
                 }
 
-                if (tcs != null)
-                {
-                    tcs.TrySetException(error);
-                }
+                tcs?.TrySetException(error);
             }
 
             public void OnNext(T value)
@@ -162,10 +156,7 @@ namespace System.Linq
                     }
                 }
 
-                if (tcs != null)
-                {
-                    tcs.TrySetResult(true);
-                }
+                tcs?.TrySetResult(true);
             }
         }