@@ -17,26 +17,26 @@ public static Task CompleteAsync(this IDataflowBlock source)
1717 return source . Completion ;
1818 }
1919
20- public static ISourceBlock < T > Buffer < T > ( this ISourceBlock < T > source , DataflowBlockOptions dataflowBlockOptions = null )
20+ public static ISourceBlock < T > Buffer < T > ( this ISourceBlock < T > source , DataflowBlockOptions ? dataflowBlockOptions = null )
2121 {
22- if ( source == null )
22+ if ( source is null )
2323 throw new NullReferenceException ( ) ;
2424 Contract . EndContractBlock ( ) ;
2525
26- var output = dataflowBlockOptions == null
26+ var output = dataflowBlockOptions is null
2727 ? new BufferBlock < T > ( )
2828 : new BufferBlock < T > ( dataflowBlockOptions ) ;
2929 source . LinkToWithCompletion ( output ) ;
3030 return output ;
3131 }
3232
33- public static ISourceBlock < T > BufferMany < T > ( this ISourceBlock < T [ ] > source , ExecutionDataflowBlockOptions dataflowBlockOptions = null )
33+ public static ISourceBlock < T > BufferMany < T > ( this ISourceBlock < T [ ] > source , ExecutionDataflowBlockOptions ? dataflowBlockOptions = null )
3434 {
35- if ( source == null )
35+ if ( source is null )
3636 throw new NullReferenceException ( ) ;
3737 Contract . EndContractBlock ( ) ;
3838
39- var output = dataflowBlockOptions == null
39+ var output = dataflowBlockOptions is null
4040 ? new TransformManyBlock < T [ ] , T > ( t => t )
4141 : new TransformManyBlock < T [ ] , T > ( t => t , dataflowBlockOptions ) ; ;
4242 source . LinkToWithCompletion ( output ) ;
@@ -45,13 +45,13 @@ public static ISourceBlock<T> BufferMany<T>(this ISourceBlock<T[]> source, Execu
4545
4646 public static ISourceBlock < T [ ] > Batch < T > ( this ISourceBlock < T > source ,
4747 int batchSize ,
48- GroupingDataflowBlockOptions dataflowBlockOptions = null )
48+ GroupingDataflowBlockOptions ? dataflowBlockOptions = null )
4949 {
50- if ( source == null )
50+ if ( source is null )
5151 throw new NullReferenceException ( ) ;
5252 Contract . EndContractBlock ( ) ;
5353
54- var batchBlock = dataflowBlockOptions == null
54+ var batchBlock = dataflowBlockOptions is null
5555 ? new BatchBlock < T > ( batchSize )
5656 : new BatchBlock < T > ( batchSize , dataflowBlockOptions ) ;
5757
@@ -62,9 +62,9 @@ public static ISourceBlock<T[]> Batch<T>(this ISourceBlock<T> source,
6262 public static int ToTargetBlock < T > ( this IEnumerable < T > source ,
6363 ITargetBlock < T > target )
6464 {
65- if ( source == null )
65+ if ( source is null )
6666 throw new NullReferenceException ( ) ;
67- if ( target == null )
67+ if ( target is null )
6868 throw new ArgumentNullException ( nameof ( target ) ) ;
6969 Contract . EndContractBlock ( ) ;
7070
@@ -83,9 +83,9 @@ public static Task<int> ToTargetBlockAsync<T>(this IEnumerable<T> source,
8383 ITargetBlock < T > target ,
8484 CancellationToken cancellationToken = default )
8585 {
86- if ( source == null )
86+ if ( source is null )
8787 throw new NullReferenceException ( ) ;
88- if ( target == null )
88+ if ( target is null )
8989 throw new ArgumentNullException ( nameof ( target ) ) ;
9090 Contract . EndContractBlock ( ) ;
9191
@@ -115,7 +115,7 @@ async Task<int> ToTargetBlockAsyncCore()
115115 public static async Task < List < T > > ToListAsync < T > ( this IReceivableSourceBlock < T > source ,
116116 CancellationToken cancellationToken = default )
117117 {
118- if ( source == null )
118+ if ( source is null )
119119 throw new NullReferenceException ( ) ;
120120 Contract . EndContractBlock ( ) ;
121121
@@ -140,7 +140,7 @@ public static ISourceBlock<T> AsBufferBlock<T>(this IEnumerable<T> source,
140140 int capacity = DataflowBlockOptions . Unbounded ,
141141 CancellationToken cancellationToken = default )
142142 {
143- if ( source == null )
143+ if ( source is null )
144144 throw new NullReferenceException ( ) ;
145145 Contract . EndContractBlock ( ) ;
146146
@@ -175,7 +175,7 @@ public static async Task<int> AllLinesTo(this TextReader source,
175175 bool completeAndAwait = false ,
176176 CancellationToken cancellationToken = default )
177177 {
178- if ( source == null )
178+ if ( source is null )
179179 throw new NullReferenceException ( ) ;
180180 Contract . EndContractBlock ( ) ;
181181
@@ -204,7 +204,7 @@ public static async Task<int> AllLinesTo<T>(this TextReader source,
204204 bool completeAndAwait = false ,
205205 CancellationToken cancellationToken = default )
206206 {
207- if ( source == null )
207+ if ( source is null )
208208 throw new NullReferenceException ( ) ;
209209 Contract . EndContractBlock ( ) ;
210210
0 commit comments