IDE suggestions

This commit is contained in:
Adrian Conlon
2024-05-19 09:07:20 +01:00
parent 6cbffa1051
commit e0235f396e
19 changed files with 151 additions and 192 deletions

View File

@@ -7,11 +7,9 @@ namespace EightBit
using System;
using System.IO;
public class Rom : Memory
public class Rom(int size) : Memory
{
private byte[] bytes;
public Rom(int size) => this.bytes = new byte[size];
private byte[] bytes = new byte[size];
public Rom()
: this(0)
@@ -53,10 +51,8 @@ namespace EightBit
public static int Load(string path, ref byte[] output, int writeOffset = 0, int readOffset = 0, int limit = -1, int maximumSize = -1)
{
using (var file = File.Open(path, FileMode.Open))
{
return Load(file, ref output, writeOffset, readOffset, limit, maximumSize);
}
using var file = File.Open(path, FileMode.Open);
return Load(file, ref output, writeOffset, readOffset, limit, maximumSize);
}
public override int Load(FileStream file, int writeOffset = 0, int readOffset = 0, int limit = -1)