Implements some micro-optimizations
Build / Build (push) Successful in 51s

This commit is contained in:
Deukhoofd committed 2025-07-05 15:46:32 +02:00
1 parent c795f20e54
commit 8a857ed232
11 files changed
+80 -21

No files matched your search

+10 -1
View File
@@ -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);
}