❔ Will I get a performance hit if I use the Enum type as a key value for a Dictionary?

See Code below:
public enum Tee1
{
    None
}

public enum Tee2
{
    None
}

class Program
{
    static Dictionary<Enum, string> h = new Dictionary<Enum, string>();
    
    static void Main(string[] args)
    {
        h.Add(Tee1.None, "Tee1 string");
        h.Add(Tee2.None, "Tee2 string");

        System.Console.WriteLine(h[Tee1.None]); // Output : Tee1 string
        System.Console.WriteLine(h[Tee2.None]); // Output : Tee2 string
    }
}


Does this also create a hashmap? Or does the compiler do something unexpected here which costs performance?
Was this page helpful?
❔ Will I get a performance hit if I use the Enum type as a key value for a Dictionary? - C#