Skip to content

Commit 23e13e0

Browse files
authored
Merge pull request #1543 from marodev/cosmetics/technical-debt
Refactors code to reduce technical debt
2 parents 9f2a809 + a017496 commit 23e13e0

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

AsyncRx.NET/System.Reactive.Async.Concurrency/System/Reactive/Concurrency/AsyncScheduler.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,7 @@ public void GetResult()
231231
throw new InvalidOperationException(); // REVIEW: No support for blocking.
232232
}
233233

234-
if (_error != null)
235-
{
236-
_error.Throw();
237-
}
234+
_error?.Throw();
238235
}
239236

240237
public void OnCompleted(Action continuation)

Ix.NET/Source/System.Interactive/System/Linq/Operators/Publish.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,7 @@ private IEnumerator<T> GetEnumeratorCore(int i)
191191
}
192192
finally
193193
{
194-
if (_buffer != null)
195-
{
196-
_buffer.Done(i + 1);
197-
}
194+
_buffer?.Done(i + 1);
198195
}
199196
}
200197
}

Ix.NET/Source/System.Linq.Async.Queryable/System/Linq/AsyncEnumerableRewriter.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,7 @@ private static ReadOnlyCollection<Expression> FixupQuotedArgs(MethodInfo method,
291291
}
292292
}
293293

294-
if (list != null)
295-
{
296-
list.Add(expression);
297-
}
294+
list?.Add(expression);
298295
}
299296

300297
//

Ix.NET/Source/System.Linq.Async/System/Linq/Disposables.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ public void Dispose()
4747
d1.Dispose();
4848

4949
var d2 = Interlocked.Exchange(ref _d2, null);
50-
if (d2 != null)
51-
{
52-
d2.Dispose();
53-
}
50+
d2?.Dispose();
5451
}
5552
}
5653
}

0 commit comments

Comments
 (0)