Simplify IDictionary accesses.

This commit is contained in:
2023-10-04 09:48:08 +01:00
parent 58394ad73d
commit d3efb58222
2 changed files with 4 additions and 8 deletions

View File

@@ -638,12 +638,9 @@ public static class FullTOC
toc.LastCompleteSession = (byte)track.Session; toc.LastCompleteSession = (byte)track.Session;
} }
if(!sessionEndingTrack.ContainsKey(toc.LastCompleteSession)) sessionEndingTrack.TryAdd(toc.LastCompleteSession, (byte)tracks.
{ Where(t => t.Session == toc.LastCompleteSession).
sessionEndingTrack[toc.LastCompleteSession] = (byte)tracks. Max(t => t.Sequence));
Where(t => t.Session == toc.LastCompleteSession).
Max(t => t.Sequence);
}
byte currentSession = 0; byte currentSession = 0;

View File

@@ -340,8 +340,7 @@ public static class Sense
Array.Copy(sense, offset, desc, 0, descLen); Array.Copy(sense, offset, desc, 0, descLen);
if(!decoded.Descriptors.ContainsKey(descType)) decoded.Descriptors.TryAdd(descType, desc);
decoded.Descriptors.Add(descType, desc);
offset += descLen; offset += descLen;
} }