mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Remove redundant parentheses.
This commit is contained in:
@@ -254,7 +254,7 @@ namespace DiscImageChef.Core
|
||||
{
|
||||
byte[] sector;
|
||||
|
||||
if((sectors - doneSectors) >= sectorsToRead)
|
||||
if(sectors - doneSectors >= sectorsToRead)
|
||||
{
|
||||
sector = image.ReadSectors(doneSectors, sectorsToRead);
|
||||
UpdateProgress2("Hashings sector {0} of {1}", (long)doneSectors, (long)sectors);
|
||||
@@ -264,7 +264,7 @@ namespace DiscImageChef.Core
|
||||
{
|
||||
sector = image.ReadSectors(doneSectors, (uint)(sectors - doneSectors));
|
||||
UpdateProgress2("Hashings sector {0} of {1}", (long)doneSectors, (long)sectors);
|
||||
doneSectors += (sectors - doneSectors);
|
||||
doneSectors += sectors - doneSectors;
|
||||
}
|
||||
|
||||
contentChkWorker.Update(sector);
|
||||
@@ -306,7 +306,7 @@ namespace DiscImageChef.Core
|
||||
sidecar.BlockMedia[0].FileSystemInformation[i] = new PartitionType
|
||||
{
|
||||
Description = partitions[i].Description,
|
||||
EndSector = (int)(partitions[i].End),
|
||||
EndSector = (int)partitions[i].End,
|
||||
Name = partitions[i].Name,
|
||||
Sequence = (int)partitions[i].Sequence,
|
||||
StartSector = (int)partitions[i].Start,
|
||||
@@ -545,8 +545,8 @@ namespace DiscImageChef.Core
|
||||
try { scpImage.OpenImage(scpFilter); }
|
||||
catch(NotImplementedException) { }
|
||||
|
||||
if((image.ImageInfo.Heads == 2 && scpImage.Header.heads == 0) ||
|
||||
(image.ImageInfo.Heads == 1 && (scpImage.Header.heads == 1 || scpImage.Header.heads == 2)))
|
||||
if(image.ImageInfo.Heads == 2 && scpImage.Header.heads == 0 ||
|
||||
image.ImageInfo.Heads == 1 && (scpImage.Header.heads == 1 || scpImage.Header.heads == 2))
|
||||
{
|
||||
if(scpImage.Header.end + 1 >= image.ImageInfo.Cylinders)
|
||||
{
|
||||
@@ -577,8 +577,8 @@ namespace DiscImageChef.Core
|
||||
if(scpImage.Tracks.TryGetValue(t, out SuperCardPro.TrackHeader scpTrack))
|
||||
{
|
||||
byte[] trackContents =
|
||||
new byte[(scpTrack.Entries.Last().dataOffset +
|
||||
scpTrack.Entries.Last().trackLength) - scpImage.Header.offsets[t] +
|
||||
new byte[scpTrack.Entries.Last().dataOffset +
|
||||
scpTrack.Entries.Last().trackLength - scpImage.Header.offsets[t] +
|
||||
1];
|
||||
scpStream.Position = scpImage.Header.offsets[t];
|
||||
scpStream.Read(trackContents, 0, trackContents.Length);
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace DiscImageChef.Core
|
||||
{
|
||||
byte[] sector;
|
||||
|
||||
if((sectors - doneSectors) >= sectorsToRead)
|
||||
if(sectors - doneSectors >= sectorsToRead)
|
||||
{
|
||||
sector = new byte[sectorsToRead * blockSize];
|
||||
fs.Read(sector, 0, sector.Length);
|
||||
@@ -112,14 +112,14 @@ namespace DiscImageChef.Core
|
||||
fs.Read(sector, 0, sector.Length);
|
||||
UpdateProgress2(string.Format("Hashing block {0} of {1} on file {2} of {3}", doneSectors, sectors, i + 1, files.Count),
|
||||
doneSectors, sectors);
|
||||
doneSectors += (sectors - doneSectors);
|
||||
doneSectors += sectors - doneSectors;
|
||||
}
|
||||
|
||||
fileWorker.Update(sector);
|
||||
tapeWorker.Update(sector);
|
||||
}
|
||||
|
||||
tapeFile.EndBlock = (tapeFile.StartBlock + sectors) - 1;
|
||||
tapeFile.EndBlock = tapeFile.StartBlock + sectors - 1;
|
||||
currentBlock += sectors;
|
||||
totalSize += fs.Length;
|
||||
tapeFile.Checksums = fileWorker.End().ToArray();
|
||||
|
||||
@@ -351,7 +351,7 @@ namespace DiscImageChef.Core
|
||||
{
|
||||
byte[] sector;
|
||||
|
||||
if((sectors - doneSectors) >= sectorsToRead)
|
||||
if(sectors - doneSectors >= sectorsToRead)
|
||||
{
|
||||
sector = image.ReadSectorsLong(doneSectors, sectorsToRead,
|
||||
(uint)xmlTrk.Sequence.TrackNumber);
|
||||
@@ -365,7 +365,7 @@ namespace DiscImageChef.Core
|
||||
(uint)xmlTrk.Sequence.TrackNumber);
|
||||
UpdateProgress2("Hashings sector {0} of {1}", (long)doneSectors,
|
||||
(long)(trk.TrackEndSector - trk.TrackStartSector + 1));
|
||||
doneSectors += (sectors - doneSectors);
|
||||
doneSectors += sectors - doneSectors;
|
||||
}
|
||||
|
||||
trkChkWorker.Update(sector);
|
||||
@@ -419,7 +419,7 @@ namespace DiscImageChef.Core
|
||||
{
|
||||
byte[] sector;
|
||||
|
||||
if((sectors - doneSectors) >= sectorsToRead)
|
||||
if(sectors - doneSectors >= sectorsToRead)
|
||||
{
|
||||
sector = image.ReadSectorsTag(doneSectors, sectorsToRead, (uint)xmlTrk.Sequence.TrackNumber,
|
||||
SectorTagType.CdSectorSubchannel);
|
||||
@@ -434,7 +434,7 @@ namespace DiscImageChef.Core
|
||||
SectorTagType.CdSectorSubchannel);
|
||||
UpdateProgress2("Hashings subchannel sector {0} of {1}", (long)doneSectors,
|
||||
(long)(trk.TrackEndSector - trk.TrackStartSector + 1));
|
||||
doneSectors += (sectors - doneSectors);
|
||||
doneSectors += sectors - doneSectors;
|
||||
}
|
||||
|
||||
subChkWorker.Update(sector);
|
||||
@@ -465,7 +465,7 @@ namespace DiscImageChef.Core
|
||||
xmlTrk.FileSystemInformation[i] = new PartitionType
|
||||
{
|
||||
Description = partitions[i].Description,
|
||||
EndSector = (int)(partitions[i].End),
|
||||
EndSector = (int)partitions[i].End,
|
||||
Name = partitions[i].Name,
|
||||
Sequence = (int)partitions[i].Sequence,
|
||||
StartSector = (int)partitions[i].Start,
|
||||
@@ -514,7 +514,7 @@ namespace DiscImageChef.Core
|
||||
Partition xmlPart = new Partition
|
||||
{
|
||||
Start = (ulong)xmlTrk.StartSector,
|
||||
Length = (ulong)((xmlTrk.EndSector - xmlTrk.StartSector) + 1),
|
||||
Length = (ulong)(xmlTrk.EndSector - xmlTrk.StartSector + 1),
|
||||
Type = xmlTrk.TrackType1.ToString(),
|
||||
Size = (ulong)xmlTrk.Size,
|
||||
Sequence = (ulong)xmlTrk.Sequence.TrackNumber
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace DiscImageChef.Core
|
||||
byte[] data;
|
||||
long position = 0;
|
||||
InitProgress();
|
||||
while(position < (fi.Length - 1048576))
|
||||
while(position < fi.Length - 1048576)
|
||||
{
|
||||
data = new byte[1048576];
|
||||
fs.Read(data, 0, 1048576);
|
||||
|
||||
Reference in New Issue
Block a user