浏览代码

Some code modernization.

Bart De Smet 8 年之前
父节点
当前提交
930cfc6cd4
共有 1 个文件被更改,包括 3 次插入12 次删除
  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)
             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)
             public void OnNext(T value)
@@ -162,10 +156,7 @@ namespace System.Linq
                     }
                     }
                 }
                 }
 
 
-                if (tcs != null)
-                {
-                    tcs.TrySetResult(true);
-                }
+                tcs?.TrySetResult(true);
             }
             }
         }
         }