Simplify IDictionary accesses.

This commit is contained in:
2023-10-04 09:48:09 +01:00
parent bfb860219f
commit 2a6e052a62
9 changed files with 22 additions and 33 deletions

View File

@@ -786,8 +786,8 @@ partial class Dump
ReadSbcData(blocks, blocksToRead, blockSize, currentTry, extents, ref currentSpeed, ref minSpeed,
ref maxSpeed, ref totalDuration, scsiReader, mhddLog, ibgLog, ref imageWriteDuration,
ref newTrim, ref dvdDecrypt,
mediaTags.ContainsKey(MediaTagType.DVD_DiscKey_Decrypted)
? mediaTags[MediaTagType.DVD_DiscKey_Decrypted]
mediaTags.TryGetValue(MediaTagType.DVD_DiscKey_Decrypted, out byte[] tag)
? tag
: null);
}
@@ -860,8 +860,8 @@ partial class Dump
_retryPasses > 0 &&
Settings.Settings.Current.EnableDecryption &&
_titleKeys &&
mediaTags.ContainsKey(MediaTagType.DVD_DiscKey_Decrypted))
RetryTitleKeys(dvdDecrypt, mediaTags[MediaTagType.DVD_DiscKey_Decrypted], ref totalDuration);
mediaTags.TryGetValue(MediaTagType.DVD_DiscKey_Decrypted, out byte[] mediaTag))
RetryTitleKeys(dvdDecrypt, mediaTag, ref totalDuration);
#endregion Error handling