From 4e668612c72ca281aaf3da4d82fed6ad88acbfd8 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sat, 2 Jan 2021 20:15:17 +1000 Subject: [PATCH] Convert LoadCueJob.TrackInfo to a readonly struct --- .../DiscFormats/CUE/CUE_Load.cs | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs index 12f49b3e4e..a46a608eaa 100644 --- a/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs +++ b/src/BizHawk.Emulation.DiscSystem/DiscFormats/CUE/CUE_Load.cs @@ -53,12 +53,22 @@ namespace BizHawk.Emulation.DiscSystem.CUE public long Length; } - //not sure if we need this... - private class TrackInfo + /// not sure if we need this... + private readonly struct TrackInfo { -// public int Length; + public readonly CompiledCueTrack CompiledCueTrack; - public CompiledCueTrack CompiledCueTrack; +#if true + public TrackInfo(CompiledCueTrack compiledCueTrack) => CompiledCueTrack = compiledCueTrack; +#else + public readonly int Length; + + public TrackInfo(CompiledCueTrack compiledCueTrack, int length) + { + CompiledCueTrack = compiledCueTrack; + Length = length; + } +#endif } private List BlobInfos; @@ -135,8 +145,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE { var cct = compiledTracks[t]; - var ti = new TrackInfo() { CompiledCueTrack = cct }; - TrackInfos.Add(ti); + TrackInfos.Add(new TrackInfo(cct)); //OH NO! CANT DO THIS! //need to read sectors from file to reliably know its ending size.