Implements some micro-optimizations
All checks were successful
Build / Build (push) Successful in 51s
All checks were successful
Build / Build (push) Successful in 51s
This commit is contained in:
@@ -6,7 +6,7 @@ namespace PkmnLib.Static;
|
||||
/// <summary>
|
||||
/// A number that identifies a type. To be used with <see cref="TypeLibrary"/>
|
||||
/// </summary>
|
||||
public readonly record struct TypeIdentifier
|
||||
public readonly struct TypeIdentifier : IEquatable<TypeIdentifier>
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the type identifier.
|
||||
@@ -27,4 +27,13 @@ public readonly record struct TypeIdentifier
|
||||
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode() => Value.GetHashCode();
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Equals(TypeIdentifier other) => Value == other.Value;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object? obj) => obj is TypeIdentifier other && Equals(other);
|
||||
|
||||
public static bool operator ==(TypeIdentifier left, TypeIdentifier right) => left.Equals(right);
|
||||
public static bool operator !=(TypeIdentifier left, TypeIdentifier right) => !left.Equals(right);
|
||||
}
|
||||
Reference in New Issue
Block a user