mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-23 23:45:14 +00:00
Cleanup NonDisposingStream for reuse
- Remove the duplicate `GC.SuppressFinalization` call (called in `System.IO.Stream) - Improve the `ThrowOnDispose` error message
This commit is contained in:
@@ -15,10 +15,9 @@ namespace SharpCompress.IO
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
if (ThrowOnDispose)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
throw new InvalidOperationException($"Attempt to dispose of a {nameof(NonDisposingStream)} when {nameof(ThrowOnDispose)} is {ThrowOnDispose}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user