mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Merge null/pattern checks into complex pattern.
This commit is contained in:
@@ -188,13 +188,11 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
MediaGeometryText =
|
||||
$"Media geometry: {imageFormat.Info.Cylinders} cylinders, {imageFormat.Info.Heads} heads, {imageFormat.Info.SectorsPerTrack} sectors per track";
|
||||
|
||||
if(imageFormat.Info.ReadableMediaTags != null &&
|
||||
imageFormat.Info.ReadableMediaTags.Count > 0)
|
||||
if(imageFormat.Info.ReadableMediaTags is { Count: > 0 })
|
||||
foreach(MediaTagType tag in imageFormat.Info.ReadableMediaTags.OrderBy(t => t))
|
||||
MediaTagsList.Add(tag.ToString());
|
||||
|
||||
if(imageFormat.Info.ReadableSectorTags != null &&
|
||||
imageFormat.Info.ReadableSectorTags.Count > 0)
|
||||
if(imageFormat.Info.ReadableSectorTags is { Count: > 0 })
|
||||
foreach(SectorTagType tag in imageFormat.Info.ReadableSectorTags.OrderBy(t => t))
|
||||
SectorTagsList.Add(tag.ToString());
|
||||
|
||||
@@ -624,8 +622,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
{
|
||||
try
|
||||
{
|
||||
if(opticalMediaImage.Sessions != null &&
|
||||
opticalMediaImage.Sessions.Count > 0)
|
||||
if(opticalMediaImage.Sessions is { Count: > 0 })
|
||||
foreach(Session session in opticalMediaImage.Sessions)
|
||||
Sessions.Add(session);
|
||||
}
|
||||
@@ -636,8 +633,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
|
||||
|
||||
try
|
||||
{
|
||||
if(opticalMediaImage.Tracks != null &&
|
||||
opticalMediaImage.Tracks.Count > 0)
|
||||
if(opticalMediaImage.Tracks is { Count: > 0 })
|
||||
foreach(Track track in opticalMediaImage.Tracks)
|
||||
Tracks.Add(track);
|
||||
}
|
||||
|
||||
@@ -99,8 +99,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
|
||||
if(!string.IsNullOrEmpty(mcn))
|
||||
McnText = mcn;
|
||||
|
||||
if(isrcs != null &&
|
||||
isrcs.Count > 0)
|
||||
if(isrcs is { Count: > 0 })
|
||||
foreach(KeyValuePair<byte, string> isrc in isrcs)
|
||||
IsrcList.Add(new IsrcModel
|
||||
{
|
||||
|
||||
@@ -37,7 +37,6 @@ using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using System.Reactive;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.Console;
|
||||
using Aaru.Core;
|
||||
@@ -302,9 +301,7 @@ public sealed class ImageEntropyViewModel : ViewModelBase
|
||||
StopVisible = false;
|
||||
ProgressVisible = true;
|
||||
|
||||
if(WholeDiscChecked &&
|
||||
_inputFormat is IOpticalMediaImage opticalFormat &&
|
||||
opticalFormat.Sessions?.Count > 1)
|
||||
if(WholeDiscChecked && _inputFormat is IOpticalMediaImage { Sessions.Count: > 1 })
|
||||
{
|
||||
AaruConsole.ErrorWriteLine("Calculating disc entropy of multisession images is not yet implemented.");
|
||||
WholeDiscChecked = false;
|
||||
|
||||
Reference in New Issue
Block a user