Enable CA2019 and fix noncompliance
"`ThreadStatic` fields should not use inline initialization"
This commit is contained in:
parent
8cfb0599e5
commit
c5d4e8b783
|
@ -98,6 +98,11 @@ dotnet_diagnostic.CA1860.severity = error
|
|||
# Use the 'StringComparison' method overloads to perform case-insensitive string comparisons
|
||||
dotnet_diagnostic.CA1862.severity = error
|
||||
|
||||
## Reliability rules
|
||||
|
||||
# `ThreadStatic` fields should not use inline initialization
|
||||
dotnet_diagnostic.CA2019.severity = error
|
||||
|
||||
## Usage rules
|
||||
|
||||
# Call GC.SuppressFinalize correctly
|
||||
|
|
|
@ -35,9 +35,17 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
public MednadiscTOC TOC;
|
||||
public MednadiscTOCTrack[] TOCTracks;
|
||||
|
||||
[ThreadStatic] private static byte[] buf2442 = new byte[2448];
|
||||
[ThreadStatic] private static byte[] buf96 = new byte[96];
|
||||
[ThreadStatic]
|
||||
private static byte[] _buf2442;
|
||||
|
||||
private static byte[] buf2442
|
||||
=> _buf2442 ??= new byte[2448]; // misnomer?
|
||||
|
||||
[ThreadStatic]
|
||||
private static byte[] _buf96;
|
||||
|
||||
private static byte[] buf96
|
||||
=> _buf96 ??= new byte[96];
|
||||
|
||||
public void Read_2442(int LBA, byte[] buffer, int offset)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue