Convert local variable or field into constant.

This commit is contained in:
2022-11-13 20:08:10 +00:00
parent f0bee36d9e
commit e449e53454
4 changed files with 31 additions and 27 deletions

View File

@@ -484,7 +484,7 @@ public static class PFI
_ => $"unknown size identifier {decoded.DiscSize}"
};
var categorySentence = "Disc is a {0} {1} version {2}";
const string categorySentence = "Disc is a {0} {1} version {2}";
switch(decoded.DiskCategory)
{
@@ -669,7 +669,7 @@ public static class PFI
if(decoded.RecordedBookType != decoded.DiskCategory)
{
var bookTypeSentence = "Disc book type is {0}";
const string bookTypeSentence = "Disc book type is {0}";
switch(decoded.RecordedBookType)
{

View File

@@ -222,7 +222,7 @@ public static class CIS
var buffer = new List<byte>();
List<string> strings = null;
var firstString = false;
var secondString = false;
const bool secondString = false;
var tuple = new Level1VersionTuple
{

View File

@@ -128,20 +128,22 @@ public static partial class Modes
if(page.ReadRetryCount > 0)
sb.AppendFormat("\tDrive will repeat read operations {0} times", page.ReadRetryCount).AppendLine();
var AllUsed = "\tAll available recovery procedures will be used.\n";
var CIRCRetriesUsed = "\tOnly retries and CIRC are used.\n";
var RetriesUsed = "\tOnly retries are used.\n";
var RecoveredNotReported = "\tRecovered errors will not be reported.\n";
var RecoveredReported = "\tRecovered errors will be reported.\n";
var RecoveredAbort = "\tRecovered errors will be reported and aborted with CHECK CONDITION.\n";
var UnrecECCAbort = "\tUnrecovered ECC errors will return CHECK CONDITION.";
var UnrecCIRCAbort = "\tUnrecovered CIRC errors will return CHECK CONDITION.";
var UnrecECCNotAbort = "\tUnrecovered ECC errors will not abort the transfer.";
var UnrecCIRCNotAbort = "\tUnrecovered CIRC errors will not abort the transfer.";
const string AllUsed = "\tAll available recovery procedures will be used.\n";
const string CIRCRetriesUsed = "\tOnly retries and CIRC are used.\n";
const string RetriesUsed = "\tOnly retries are used.\n";
const string RecoveredNotReported = "\tRecovered errors will not be reported.\n";
const string RecoveredReported = "\tRecovered errors will be reported.\n";
const string RecoveredAbort = "\tRecovered errors will be reported and aborted with CHECK CONDITION.\n";
const string UnrecECCAbort = "\tUnrecovered ECC errors will return CHECK CONDITION.";
const string UnrecCIRCAbort = "\tUnrecovered CIRC errors will return CHECK CONDITION.";
const string UnrecECCNotAbort = "\tUnrecovered ECC errors will not abort the transfer.";
const string UnrecCIRCNotAbort = "\tUnrecovered CIRC errors will not abort the transfer.";
var UnrecECCAbortData = "\tUnrecovered ECC errors will return CHECK CONDITION and the uncorrected data.";
const string UnrecECCAbortData =
"\tUnrecovered ECC errors will return CHECK CONDITION and the uncorrected data.";
var UnrecCIRCAbortData = "\tUnrecovered CIRC errors will return CHECK CONDITION and the uncorrected data.";
const string UnrecCIRCAbortData =
"\tUnrecovered CIRC errors will return CHECK CONDITION and the uncorrected data.";
switch(page.Parameter)
{

View File

@@ -93,20 +93,22 @@ public static partial class Modes
if(page.VerifyRetryCount > 0)
sb.AppendFormat("\tDrive will repeat verify operations {0} times", page.VerifyRetryCount).AppendLine();
var AllUsed = "\tAll available recovery procedures will be used.\n";
var CIRCRetriesUsed = "\tOnly retries and CIRC are used.\n";
var RetriesUsed = "\tOnly retries are used.\n";
var RecoveredNotReported = "\tRecovered errors will not be reported.\n";
var RecoveredReported = "\tRecovered errors will be reported.\n";
var RecoveredAbort = "\tRecovered errors will be reported and aborted with CHECK CONDITION.\n";
var UnrecECCAbort = "\tUnrecovered ECC errors will return CHECK CONDITION.";
var UnrecCIRCAbort = "\tUnrecovered CIRC errors will return CHECK CONDITION.";
var UnrecECCNotAbort = "\tUnrecovered ECC errors will not abort the transfer.";
var UnrecCIRCNotAbort = "\tUnrecovered CIRC errors will not abort the transfer.";
const string AllUsed = "\tAll available recovery procedures will be used.\n";
const string CIRCRetriesUsed = "\tOnly retries and CIRC are used.\n";
const string RetriesUsed = "\tOnly retries are used.\n";
const string RecoveredNotReported = "\tRecovered errors will not be reported.\n";
const string RecoveredReported = "\tRecovered errors will be reported.\n";
const string RecoveredAbort = "\tRecovered errors will be reported and aborted with CHECK CONDITION.\n";
const string UnrecECCAbort = "\tUnrecovered ECC errors will return CHECK CONDITION.";
const string UnrecCIRCAbort = "\tUnrecovered CIRC errors will return CHECK CONDITION.";
const string UnrecECCNotAbort = "\tUnrecovered ECC errors will not abort the transfer.";
const string UnrecCIRCNotAbort = "\tUnrecovered CIRC errors will not abort the transfer.";
var UnrecECCAbortData = "\tUnrecovered ECC errors will return CHECK CONDITION and the uncorrected data.";
const string UnrecECCAbortData =
"\tUnrecovered ECC errors will return CHECK CONDITION and the uncorrected data.";
var UnrecCIRCAbortData = "\tUnrecovered CIRC errors will return CHECK CONDITION and the uncorrected data.";
const string UnrecCIRCAbortData =
"\tUnrecovered CIRC errors will return CHECK CONDITION and the uncorrected data.";
switch(page.Parameter)
{