hardkoded / puppeteer-sharp

Headless Chrome .NET API
https://www.puppeteersharp.com
MIT License
3.36k stars 440 forks source link

Apply the Type-Dictionary Trick #2743

Closed jnyrup closed 1 month ago

jnyrup commented 1 month ago

First proposed in https://github.com/hardkoded/puppeteer-sharp/pull/2713#discussion_r1703996482

This avoid constructing the instances of ConcurrentDictionary in EnumHelper by applying the "Type-Dictionary Trick" from https://mariusgundersen.net/type-dictionary-trick/.

In addition this PR changes the .NET 8 TFM to use generic Enum variants.