Make a ton of VS-recommended changes. Sure, why not.

This commit is contained in:
2020-12-22 13:04:55 -06:00
parent f420af35cc
commit 0a3fe365d0
17 changed files with 56 additions and 53 deletions

10
Q14.cs
View File

@ -21,7 +21,7 @@ namespace _2020
public List<byte> mask = new List<byte>();
public List<WriteInstruction> writeInstructions = new List<WriteInstruction>();
}
static List<Instruction> instructions = new List<Instruction>();
static readonly List<Instruction> instructions = new List<Instruction>();
public static void Go()
{
@ -64,9 +64,11 @@ namespace _2020
{
var inst = instructions[^1];
var writeInst = new Instruction.WriteInstruction();
writeInst.idx = Convert.ToUInt64(line["mem[".Length..line.IndexOf("]")]);
writeInst.value = Convert.ToUInt64(line[(line.IndexOf('=') + 1)..]);
var writeInst = new Instruction.WriteInstruction
{
idx = Convert.ToUInt64(line["mem[".Length..line.IndexOf("]")]),
value = Convert.ToUInt64(line[(line.IndexOf('=') + 1)..])
};
inst.writeInstructions.Add(writeInst);
}