REFACTOR: Reformat code.

This commit is contained in:
2017-12-19 20:33:03 +00:00
parent 77edc7c91c
commit e6f6ace80b
704 changed files with 82627 additions and 83641 deletions

View File

@@ -98,12 +98,10 @@ namespace DiscImageChef.Commands
{
byte[] garbage;
string sectorHash = sha1ctxTrack.Data(sector, out garbage);
if(!uniqueSectorsPerTrack.Contains(sectorHash))
uniqueSectorsPerTrack.Add(sectorHash);
if(!uniqueSectorsPerTrack.Contains(sectorHash)) uniqueSectorsPerTrack.Add(sectorHash);
}
foreach(byte b in sector)
entTable[b]++;
foreach(byte b in sector) entTable[b]++;
trackSize += (ulong)sector.LongLength;
}
@@ -121,7 +119,9 @@ namespace DiscImageChef.Commands
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
if(options.DuplicatedSectors)
DicConsole.WriteLine("Track {0} has {1} unique sectors ({1:P3})", currentTrack.TrackSequence, uniqueSectorsPerTrack.Count, (double)uniqueSectorsPerTrack.Count / (double)sectors);
DicConsole.WriteLine("Track {0} has {1} unique sectors ({1:P3})",
currentTrack.TrackSequence, uniqueSectorsPerTrack.Count,
(double)uniqueSectorsPerTrack.Count / (double)sectors);
#pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created
DicConsole.WriteLine();
@@ -129,14 +129,11 @@ namespace DiscImageChef.Commands
}
catch(Exception ex)
{
if(options.Debug)
DicConsole.DebugWriteLine("Could not get tracks because {0}", ex.Message);
else
DicConsole.ErrorWriteLine("Unable to get separate tracks, not calculating their entropy");
if(options.Debug) DicConsole.DebugWriteLine("Could not get tracks because {0}", ex.Message);
else DicConsole.ErrorWriteLine("Unable to get separate tracks, not calculating their entropy");
}
}
if(options.WholeDisc)
{
SHA1Context sha1Ctx = new SHA1Context();
@@ -158,15 +155,12 @@ namespace DiscImageChef.Commands
{
byte[] garbage;
string sectorHash = sha1Ctx.Data(sector, out garbage);
if(!uniqueSectors.Contains(sectorHash))
uniqueSectors.Add(sectorHash);
if(!uniqueSectors.Contains(sectorHash)) uniqueSectors.Add(sectorHash);
}
foreach(byte b in sector)
entTable[b]++;
foreach(byte b in sector) entTable[b]++;
diskSize += (ulong)sector.LongLength;
}
double entropy = 0;
@@ -184,12 +178,12 @@ namespace DiscImageChef.Commands
if(options.DuplicatedSectors)
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
DicConsole.WriteLine("Disk has {0} unique sectors ({1:P3})", uniqueSectors.Count, (double)uniqueSectors.Count / (double)sectors);
DicConsole.WriteLine("Disk has {0} unique sectors ({1:P3})", uniqueSectors.Count,
(double)uniqueSectors.Count / (double)sectors);
#pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created
Core.Statistics.AddCommand("entropy");
}
}
}
}
}