Convert local variable or field into constant.

This commit is contained in:
2022-11-13 20:08:10 +00:00
parent fca57318f5
commit 0f94c5fc01
16 changed files with 75 additions and 85 deletions

View File

@@ -393,9 +393,9 @@ public sealed partial class Sidecar
// For fast debugging, skip checksum
//goto skipImageChecksum;
uint sectorsToRead = 64;
ulong sectors = image.Info.Sectors;
ulong doneSectors = 0;
const uint sectorsToRead = 64;
ulong sectors = image.Info.Sectors;
ulong doneSectors = 0;
InitProgress2();
@@ -495,9 +495,9 @@ public sealed partial class Sidecar
// For fast debugging, skip checksum
//goto skipImageChecksum;
uint sectorsToRead = 64;
ulong sectors = tapePartition.LastBlock - tapePartition.FirstBlock + 1;
ulong doneSectors = 0;
const uint sectorsToRead = 64;
ulong sectors = tapePartition.LastBlock - tapePartition.FirstBlock + 1;
ulong doneSectors = 0;
InitProgress2();
@@ -595,9 +595,9 @@ public sealed partial class Sidecar
// For fast debugging, skip checksum
//goto skipImageChecksum;
uint sectorsToRead = 64;
ulong sectors = tapeFile.LastBlock - tapeFile.FirstBlock + 1;
ulong doneSectors = 0;
const uint sectorsToRead = 64;
ulong sectors = tapeFile.LastBlock - tapeFile.FirstBlock + 1;
ulong doneSectors = 0;
InitProgress2();

View File

@@ -336,9 +336,9 @@ public sealed partial class Sidecar
xmlTrk.BytesPerSector = (uint)trk.BytesPerSector;
uint sectorsToRead = 512;
ulong sectors = xmlTrk.EndSector - xmlTrk.StartSector + 1;
ulong doneSectors = 0;
const uint sectorsToRead = 512;
ulong sectors = xmlTrk.EndSector - xmlTrk.StartSector + 1;
ulong doneSectors = 0;
// If there is only one track, and it's the same as the image file (e.g. ".iso" files), don't re-checksum.
if(image.Id == new Guid("12345678-AAAA-BBBB-CCCC-123456789000") &&