I have a C# struct which I use as the key in a standard Dictionary collection. I've written overrides for both its GetHashCode and Equals, but I'm a little unhappy that Equals is given a boxed object instead of a reference to my struct type directly.
Is there anything I can do to optimize my use of Dictionary with my struct type to avoid the unnecessary boxing operation?
(This isn't premature optimization but entirely appropriate optimization, thank you very much.)