From 58907e2c290473326e5ab74bdfe1429b8a518ba4 Mon Sep 17 00:00:00 2001 From: Marco Carvalho Date: Thu, 22 Jun 2023 13:36:07 -0300 Subject: GetHashCode should not reference mutable fields (#5331) --- src/Spv.Generator/ConstantKey.cs | 2 +- src/Spv.Generator/DeterministicStringKey.cs | 2 +- src/Spv.Generator/LiteralString.cs | 2 +- src/Spv.Generator/TypeDeclarationKey.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Spv.Generator') diff --git a/src/Spv.Generator/ConstantKey.cs b/src/Spv.Generator/ConstantKey.cs index d3c1b905..e7758b40 100644 --- a/src/Spv.Generator/ConstantKey.cs +++ b/src/Spv.Generator/ConstantKey.cs @@ -5,7 +5,7 @@ namespace Spv.Generator { internal struct ConstantKey : IEquatable { - private Instruction _constant; + private readonly Instruction _constant; public ConstantKey(Instruction constant) { diff --git a/src/Spv.Generator/DeterministicStringKey.cs b/src/Spv.Generator/DeterministicStringKey.cs index 491bb745..cab4dbcc 100644 --- a/src/Spv.Generator/DeterministicStringKey.cs +++ b/src/Spv.Generator/DeterministicStringKey.cs @@ -5,7 +5,7 @@ namespace Spv.Generator { internal class DeterministicStringKey : IEquatable { - private string _value; + private readonly string _value; public DeterministicStringKey(string value) { diff --git a/src/Spv.Generator/LiteralString.cs b/src/Spv.Generator/LiteralString.cs index 629ff7bf..741d922b 100644 --- a/src/Spv.Generator/LiteralString.cs +++ b/src/Spv.Generator/LiteralString.cs @@ -8,7 +8,7 @@ namespace Spv.Generator { public OperandType Type => OperandType.String; - private string _value; + private readonly string _value; public LiteralString(string value) { diff --git a/src/Spv.Generator/TypeDeclarationKey.cs b/src/Spv.Generator/TypeDeclarationKey.cs index a4aa9563..e4fd5fd5 100644 --- a/src/Spv.Generator/TypeDeclarationKey.cs +++ b/src/Spv.Generator/TypeDeclarationKey.cs @@ -5,7 +5,7 @@ namespace Spv.Generator { internal struct TypeDeclarationKey : IEquatable { - private Instruction _typeDeclaration; + private readonly Instruction _typeDeclaration; public TypeDeclarationKey(Instruction typeDeclaration) { -- cgit v1.2.3