mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Convert part of loop body into LINQ expression.
This commit is contained in:
Submodule Aaru.CommonTypes updated: 9859c8d9eb...2a93125433
Submodule Aaru.Decoders updated: 8df73a2b23...58394ad73d
@@ -275,13 +275,9 @@ public sealed partial class A2R
|
|||||||
|
|
||||||
string[] metaFields = metaData.Split('\n');
|
string[] metaFields = metaData.Split('\n');
|
||||||
|
|
||||||
foreach(string field in metaFields)
|
foreach(string[] keyValue in metaFields.Select(field => field.Split('\t')).
|
||||||
{
|
Where(keyValue => keyValue.Length == 2))
|
||||||
string[] keyValue = field.Split('\t');
|
|
||||||
|
|
||||||
if(keyValue.Length == 2)
|
|
||||||
Meta.Add(keyValue[0], keyValue[1]);
|
Meta.Add(keyValue[0], keyValue[1]);
|
||||||
}
|
|
||||||
|
|
||||||
if(Meta.TryGetValue("image_date", out string imageDate))
|
if(Meta.TryGetValue("image_date", out string imageDate))
|
||||||
_imageInfo.CreationTime = DateTime.Parse(imageDate);
|
_imageInfo.CreationTime = DateTime.Parse(imageDate);
|
||||||
|
|||||||
@@ -174,14 +174,13 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
|
|||||||
|
|
||||||
bool useLong = inputFormat.Info.ReadableSectorTags.Except(new[] { SectorTagType.CdTrackFlags }).Any();
|
bool useLong = inputFormat.Info.ReadableSectorTags.Except(new[] { SectorTagType.CdTrackFlags }).Any();
|
||||||
|
|
||||||
foreach(SectorTagType sectorTag in inputFormat.Info.ReadableSectorTags.Where(sectorTag =>
|
// TODO: Can be done with LINQ only
|
||||||
!outputFormat.SupportedSectorTags.Contains(sectorTag)))
|
foreach(SectorTagType _ in inputFormat.Info.ReadableSectorTags.Where(sectorTag =>
|
||||||
{
|
!outputFormat.SupportedSectorTags.Contains(sectorTag)).Where(
|
||||||
if(sectorTag != SectorTagType.CdTrackFlags &&
|
sectorTag => sectorTag != SectorTagType.CdTrackFlags &&
|
||||||
sectorTag != SectorTagType.CdTrackIsrc &&
|
sectorTag != SectorTagType.CdTrackIsrc &&
|
||||||
sectorTag != SectorTagType.CdSectorSubchannel)
|
sectorTag != SectorTagType.CdSectorSubchannel))
|
||||||
useLong = false;
|
useLong = false;
|
||||||
}
|
|
||||||
|
|
||||||
Assert.IsTrue(
|
Assert.IsTrue(
|
||||||
outputFormat.Create(outputPath, inputFormat.Info.MediaType, new Dictionary<string, string>(),
|
outputFormat.Create(outputPath, inputFormat.Info.MediaType, new Dictionary<string, string>(),
|
||||||
@@ -455,10 +454,8 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
|
|||||||
if(trackFlags.Count > 0)
|
if(trackFlags.Count > 0)
|
||||||
{
|
{
|
||||||
foreach((byte track, byte flags) in trackFlags)
|
foreach((byte track, byte flags) in trackFlags)
|
||||||
{
|
|
||||||
outputFormat.WriteSectorTag(new[] { flags }, track, SectorTagType.CdTrackFlags);
|
outputFormat.WriteSectorTag(new[] { flags }, track, SectorTagType.CdTrackFlags);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(mcn != null)
|
if(mcn != null)
|
||||||
outputFormat.WriteMediaTag(Encoding.UTF8.GetBytes(mcn), MediaTagType.CD_MCN);
|
outputFormat.WriteMediaTag(Encoding.UTF8.GetBytes(mcn), MediaTagType.CD_MCN);
|
||||||
|
|||||||
Reference in New Issue
Block a user