aboutsummaryrefslogtreecommitdiff
path: root/src/Spv.Generator
diff options
context:
space:
mode:
authorMarco Carvalho <marcolucio27@gmail.com>2023-06-22 13:36:07 -0300
committerGitHub <noreply@github.com>2023-06-22 18:36:07 +0200
commit58907e2c290473326e5ab74bdfe1429b8a518ba4 (patch)
tree4d47637c517b0b0540e584acf4ad52d0b7b9e544 /src/Spv.Generator
parent649d372f7da8559f8b6d74ca44af64ba7d7853c4 (diff)
GetHashCode should not reference mutable fields (#5331)
Diffstat (limited to 'src/Spv.Generator')
-rw-r--r--src/Spv.Generator/ConstantKey.cs2
-rw-r--r--src/Spv.Generator/DeterministicStringKey.cs2
-rw-r--r--src/Spv.Generator/LiteralString.cs2
-rw-r--r--src/Spv.Generator/TypeDeclarationKey.cs2
4 files changed, 4 insertions, 4 deletions
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<ConstantKey>
{
- 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<DeterministicStringKey>
{
- 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<TypeDeclarationKey>
{
- private Instruction _typeDeclaration;
+ private readonly Instruction _typeDeclaration;
public TypeDeclarationKey(Instruction typeDeclaration)
{