mirror of
https://github.com/Ryujinx-NX/Ryujinx.git
synced 2024-11-14 13:07:41 -07:00
31 lines
903 B
C#
31 lines
903 B
C#
|
using System;
|
|||
|
using System.Diagnostics.CodeAnalysis;
|
|||
|
|
|||
|
namespace Spv.Generator
|
|||
|
{
|
|||
|
internal struct TypeDeclarationKey : IEquatable<TypeDeclarationKey>
|
|||
|
{
|
|||
|
private 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 && Equals((TypeDeclarationKey)obj);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|