Uh oh!
There was an error while loading. Please reload this page.
Use span-based dictionary lookup in System.Console - #103742
Conversation
Tagging subscribers to this area: @dotnet/area-system-console |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| } | ||
| Dictionary<ReadOnlyMemory<char>, ConsoleKeyInfo> terminfoDb = terminalFormatStrings.KeyFormatToConsoleKey; // the most important source of truth | ||
| Dictionary<string, ConsoleKeyInfo>.AlternateLookup<ReadOnlySpan<char>> terminfoDb = // the most important source of truth |
There was a problem hiding this comment.
Shouldn't we be caching the alternate lookup struct somewhere? This is incurring a runtime type test against a generic interface which presumably would add up assuming this is a performance sensitive application.
There was a problem hiding this comment.
Didn't seem worth trying to avoid the overhead of a cast as part of the handling of a user's key strokes?
adamsitnik
left a comment
There was a problem hiding this comment.
LGTM, thank you @stephentoub !
stephentoub
commented
Jun 21, 2024
/ba-g failures are known |
* Use span-based dictionary lookup in System.Console * Fix ctor

No description provided.