diff --git a/Aaru.CommonTypes b/Aaru.CommonTypes index 9859c8d9e..2a9312543 160000 --- a/Aaru.CommonTypes +++ b/Aaru.CommonTypes @@ -1 +1 @@ -Subproject commit 9859c8d9eb7a9ea33f6eb70a22b8716526cace9d +Subproject commit 2a93125433ee14204ce65b4dedec5044ea1168fe diff --git a/Aaru.Decoders b/Aaru.Decoders index 8df73a2b2..58394ad73 160000 --- a/Aaru.Decoders +++ b/Aaru.Decoders @@ -1 +1 @@ -Subproject commit 8df73a2b23cd2bb49d13ce08f4665182f4ae650c +Subproject commit 58394ad73deece613e617b9f1ac750fc6845b6ba diff --git a/Aaru.Images/A2R/Read.cs b/Aaru.Images/A2R/Read.cs index e7de15c4b..532a9990f 100644 --- a/Aaru.Images/A2R/Read.cs +++ b/Aaru.Images/A2R/Read.cs @@ -275,13 +275,9 @@ public sealed partial class A2R string[] metaFields = metaData.Split('\n'); - foreach(string field in metaFields) - { - string[] keyValue = field.Split('\t'); - - if(keyValue.Length == 2) - Meta.Add(keyValue[0], keyValue[1]); - } + foreach(string[] keyValue in metaFields.Select(field => field.Split('\t')). + Where(keyValue => keyValue.Length == 2)) + Meta.Add(keyValue[0], keyValue[1]); if(Meta.TryGetValue("image_date", out string imageDate)) _imageInfo.CreationTime = DateTime.Parse(imageDate); diff --git a/Aaru.Tests/WritableImages/WritableOpticalMediaImageTest.cs b/Aaru.Tests/WritableImages/WritableOpticalMediaImageTest.cs index fd80e421c..af90ed48c 100644 --- a/Aaru.Tests/WritableImages/WritableOpticalMediaImageTest.cs +++ b/Aaru.Tests/WritableImages/WritableOpticalMediaImageTest.cs @@ -174,14 +174,13 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest bool useLong = inputFormat.Info.ReadableSectorTags.Except(new[] { SectorTagType.CdTrackFlags }).Any(); - foreach(SectorTagType sectorTag in inputFormat.Info.ReadableSectorTags.Where(sectorTag => - !outputFormat.SupportedSectorTags.Contains(sectorTag))) - { - if(sectorTag != SectorTagType.CdTrackFlags && - sectorTag != SectorTagType.CdTrackIsrc && - sectorTag != SectorTagType.CdSectorSubchannel) - useLong = false; - } + // TODO: Can be done with LINQ only + foreach(SectorTagType _ in inputFormat.Info.ReadableSectorTags.Where(sectorTag => + !outputFormat.SupportedSectorTags.Contains(sectorTag)).Where( + sectorTag => sectorTag != SectorTagType.CdTrackFlags && + sectorTag != SectorTagType.CdTrackIsrc && + sectorTag != SectorTagType.CdSectorSubchannel)) + useLong = false; Assert.IsTrue( outputFormat.Create(outputPath, inputFormat.Info.MediaType, new Dictionary(), @@ -455,9 +454,7 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest if(trackFlags.Count > 0) { foreach((byte track, byte flags) in trackFlags) - { outputFormat.WriteSectorTag(new[] { flags }, track, SectorTagType.CdTrackFlags); - } } if(mcn != null)