Ryujinx/src/Spv.Generator/TypeDeclarationKey.cs
TSRBerry 2989c163a8
editorconfig: Set default encoding to UTF-8 (#5793)
* editorconfig: Add default charset

* Change file encoding from UTF-8-BOM to UTF-8
2023-12-04 14:17:13 +01:00

31 lines
902 B
C#

using System;
using System.Diagnostics.CodeAnalysis;
namespace Spv.Generator
{
internal readonly struct TypeDeclarationKey : IEquatable<TypeDeclarationKey>
{
private readonly Instruction _typeDeclaration;
public TypeDeclarationKey(Instruction typeDeclaration)
{
_typeDeclaration = typeDeclaration;
}
public override int GetHashCode()
{
return DeterministicHashCode.Combine(_typeDeclaration.Opcode, _typeDeclaration.GetHashCodeContent());
}
public bool Equals(TypeDeclarationKey other)
{
return _typeDeclaration.Opcode == other._typeDeclaration.Opcode && _typeDeclaration.EqualsContent(other._typeDeclaration);
}
public override bool Equals([NotNullWhen(true)] object obj)
{
return obj is TypeDeclarationKey key && Equals(key);
}
}
}