Skip to content

Commit 2be6b6e

Browse files
committed
Merge branch 'patch-1' of github.com:CaringDev/CsvHelper into CaringDev-patch-1
# Conflicts: # src/CsvHelper/CsvWriter.cs
2 parents 5dad8b8 + d19f38e commit 2be6b6e

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

src/CsvHelper/CsvWriter.cs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -506,11 +506,7 @@ public virtual async Task WriteRecordsAsync(IEnumerable records, CancellationTok
506506
}
507507
finally
508508
{
509-
if (enumerator is IAsyncDisposable asyncDisposable)
510-
{
511-
await asyncDisposable.DisposeAsync().ConfigureAwait(false);
512-
}
513-
else if (enumerator is IDisposable disposable)
509+
if (enumerator is IDisposable disposable)
514510
{
515511
disposable.Dispose();
516512
}
@@ -570,15 +566,10 @@ public virtual async Task WriteRecordsAsync<T>(IEnumerable<T> records, Cancellat
570566
}
571567
finally
572568
{
573-
if (enumerator is IAsyncDisposable asyncDisposable)
574-
{
575-
await asyncDisposable.DisposeAsync().ConfigureAwait(false);
576-
}
577-
else if (enumerator is IDisposable disposable)
569+
if (enumerator is IDisposable disposable)
578570
{
579571
disposable.Dispose();
580572
}
581-
582573
}
583574
}
584575

@@ -639,10 +630,6 @@ public virtual async Task WriteRecordsAsync<T>(IAsyncEnumerable<T> records, Canc
639630
{
640631
await asyncDisposable.DisposeAsync().ConfigureAwait(false);
641632
}
642-
else if (enumerator is IDisposable disposable)
643-
{
644-
disposable.Dispose();
645-
}
646633
}
647634
}
648635

0 commit comments

Comments
 (0)