diff options
author | Tlakaelel Axayakatl Ceja <tlakaelel_axayakatl@outlook.com> | 2022-09-01 23:02:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-01 23:02:43 +0300 |
commit | ab2d195f169a08bf8eb978b472b2d3aca61b0a46 (patch) | |
tree | 4e441a8841728347e13d9a14f0b457340d134ef1 /src/coreclr/tools/Common/TypeSystem/IL/ILDisassembler.cs | |
parent | 7a45201181d37329b7ab0bee541ed7c42b5d94b6 (diff) |
Run code quality analyzers in the coreclr/tools directory (#74825)
Run codeanalysis analyzers in the coreclr/tools directory
Diffstat (limited to 'src/coreclr/tools/Common/TypeSystem/IL/ILDisassembler.cs')
-rw-r--r-- | src/coreclr/tools/Common/TypeSystem/IL/ILDisassembler.cs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/ILDisassembler.cs b/src/coreclr/tools/Common/TypeSystem/IL/ILDisassembler.cs index f11ed8cf5db..864850ecc9c 100644 --- a/src/coreclr/tools/Common/TypeSystem/IL/ILDisassembler.cs +++ b/src/coreclr/tools/Common/TypeSystem/IL/ILDisassembler.cs @@ -143,7 +143,7 @@ namespace Internal.IL sb.Append(field.Name); } - private void AppendStringLiteral(StringBuilder sb, string s) + private static void AppendStringLiteral(StringBuilder sb, string s) { sb.Append('"'); for (int i = 0; i < s.Length; i++) @@ -187,20 +187,21 @@ namespace Internal.IL return _ilBytes[_currentOffset++]; } - private UInt16 ReadILUInt16() + private ushort ReadILUInt16() { - UInt16 val = (UInt16)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8)); + ushort val = (ushort)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8)); _currentOffset += 2; return val; } - private UInt32 ReadILUInt32() + private uint ReadILUInt32() { - UInt32 val = (UInt32)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8) + (_ilBytes[_currentOffset + 2] << 16) + (_ilBytes[_currentOffset + 3] << 24)); + uint val = (uint)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8) + (_ilBytes[_currentOffset + 2] << 16) + (_ilBytes[_currentOffset + 3] << 24)); _currentOffset += 4; return val; } + private int ReadILToken() { return (int)ReadILUInt32(); @@ -418,7 +419,7 @@ namespace Internal.IL int delta = (int)ReadILUInt32(); AppendOffset(decodedInstruction, jmpBase + delta); } - decodedInstruction.Append(")"); + decodedInstruction.Append(')'); return decodedInstruction.ToString(); } @@ -493,7 +494,7 @@ namespace Internal.IL public override void AppendName(StringBuilder sb, SignatureTypeVariable type) { - sb.Append("!"); + sb.Append('!'); sb.Append(type.Index.ToStringInvariant()); } @@ -514,7 +515,7 @@ namespace Internal.IL if (i > 0) sb.Append(", "); AppendNameWithValueClassPrefix(sb, type.Instantiation[i]); - } + } sb.Append('>'); } |