From 5c6cfa27e73fe2be0cd9fe830341f1125c9989fb Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 29 Mar 2021 22:55:45 -0700 Subject: [PATCH] Make ComboItem a record https://github.com/kwsch/PKHeX/commit/74ee22e66e1f785e57c8bd96271d77b81afecc3b --- NHSE.Core/Util/ComboItem.cs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/NHSE.Core/Util/ComboItem.cs b/NHSE.Core/Util/ComboItem.cs index b8761d5..3e182fb 100644 --- a/NHSE.Core/Util/ComboItem.cs +++ b/NHSE.Core/Util/ComboItem.cs @@ -6,24 +6,7 @@ namespace NHSE.Core /// /// Key Value pair for a displayed and underlying value. /// - public readonly struct ComboItem : IEquatable - { - public string Text { get; } - public int Value { get; } - - public ComboItem(string text, int value) - { - Text = text; - Value = value; - } - - public bool Equals(ComboItem other) => Value == other.Value && string.Equals(Text, other.Text); - public bool Equals(int other) => Value == other; - public override bool Equals(object obj) => obj is ComboItem other && Equals(other); - public override int GetHashCode() => Value; - public static bool operator ==(ComboItem left, ComboItem right) => left.Equals(right); - public static bool operator !=(ComboItem left, ComboItem right) => !(left == right); - } + public record ComboItem(string Text, int Value); public static class ComboItemUtil {