mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2026-04-26 17:17:49 +00:00
Apply .net 9 analysis
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
namespace M6502.HarteTest
|
||||
{
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
@@ -12,28 +13,28 @@
|
||||
};
|
||||
private bool _disposed;
|
||||
|
||||
public string Path { get; set; } = path;
|
||||
public string Path { get; } = path;
|
||||
|
||||
private readonly FileStream _stream = File.Open(path, FileMode.Open);
|
||||
|
||||
public IAsyncEnumerable<Test?> TestsAsync => JsonSerializer.DeserializeAsyncEnumerable<Test>(_stream, SerializerOptions);
|
||||
public ConfiguredCancelableAsyncEnumerable<Test?> TestsAsync => JsonSerializer.DeserializeAsyncEnumerable<Test>(this._stream, SerializerOptions).ConfigureAwait(false);
|
||||
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (!_disposed)
|
||||
if (!this._disposed)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
_stream.Dispose();
|
||||
this._stream.Dispose();
|
||||
}
|
||||
|
||||
_disposed = true;
|
||||
this._disposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(disposing: true);
|
||||
this.Dispose(disposing: true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user