Uh oh!
There was an error while loading. Please reload this page.
Add OrderedDictionary - #103309
Conversation
ghost
commented
Jun 11, 2024
Note regarding the |
1 similar comment
ghost
commented
Jun 11, 2024
Note regarding the |
kronic
commented
Jun 12, 2024
@stephentoub@terrajobst publicvoidMove(intoldIndex,intnewIndex);publicvoidStort(IComparer<TValue>comparer); |
eiriktsarpalis
commented
Jun 12, 2024
Adding some kind of sorting functionality would be useful, but ideally that should be solved for IList in general, cf. #76375 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This rewrites the core of the type to be based on a custom data structure rather than wrapping Dictionary and List. The core structure is based on both Dictionary in corelib and the OrderedDictionary prototype in corefxlab. This also adds missing TryAdd, Capacity, EnsureCapacity, and TrimExcess members for parity with Dictionary, and fixes debugger views for the Key/ValueCollections.
e7e543c to
a4dca87Comparestephentoub
commented
Jun 13, 2024
@eiriktsarpalis, please take another look when you get a chance. I redid the guts based on the feedback to prioritize enumeration. It's based on a combination of approaches taken by |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
stephentoub
commented
Jun 14, 2024
/ba-g all failures are known |
AndreyAkinshin
commented
Jun 14, 2024
@stephentoub Thank you very much for doing this! It's fantastic that we can finally use generic OrderedDirectiory out of the box without using 3rd-party NuGet packages or implementing it from scratch. |
| // to record the newly updated indices. | ||
| for (i = _count - 1; i >= index; --i) | ||
| { | ||
| entries[i + 1] = entries[i]; |
There was a problem hiding this comment.
Is there a chance we could perf improvement if the shifting of the entries array used block copying?
There was a problem hiding this comment.
Possibly. But we still need to walk the entries individually to fix up the chains. We can more easily experiment with it once it's in a daily.
Closes#24826