Convert LoadCueJob.TrackInfo to a readonly struct

This commit is contained in:
YoshiRulz 2021-01-02 20:15:17 +10:00
parent 84a6c5a426
commit 4e668612c7
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 15 additions and 6 deletions

View File

@ -53,12 +53,22 @@ namespace BizHawk.Emulation.DiscSystem.CUE
public long Length; public long Length;
} }
//not sure if we need this... /// <remarks>not sure if we need this...</remarks>
private class TrackInfo 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<BlobInfo> BlobInfos; private List<BlobInfo> BlobInfos;
@ -135,8 +145,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
{ {
var cct = compiledTracks[t]; var cct = compiledTracks[t];
var ti = new TrackInfo() { CompiledCueTrack = cct }; TrackInfos.Add(new TrackInfo(cct));
TrackInfos.Add(ti);
//OH NO! CANT DO THIS! //OH NO! CANT DO THIS!
//need to read sectors from file to reliably know its ending size. //need to read sectors from file to reliably know its ending size.