Skip to content

Commit

Permalink
Optimize conversion of Key enum from/to string, reduce allocations (d…
Browse files Browse the repository at this point in the history
…otnet#9697)

* Simplify CanConvertFrom

* Simplify CanConvertTo

* Speed up and simplify ConvertFrom, add fast-path for F-keys

* Speed up and simplify ConvertTo, add IsDefinedKey helper

* Add documentation, formatting adjustments only

* Use IsDefinedKey in CanConvertTo as well

* Remove redundant usings

* Fix an unlikely IndexOutOfRangeException we could have introduced

* Prevent behaviour change, let it throw an exception

* Address PR feedback

* Address nits, fix spelling
  • Loading branch information
h3xds1nz authored Dec 30, 2024
1 parent e1babd2 commit c8c970b
Showing 1 changed file with 267 additions and 176 deletions.
Loading

0 comments on commit c8c970b

Please # to comment.