Skip to content

Fix sorting of 'wrapping' items.#43317

Merged
2 commits merged intodotnet:masterfrom
CyrusNajmabadi:fixWrappingSorting
Apr 13, 2020
Merged

Fix sorting of 'wrapping' items.#43317
2 commits merged intodotnet:masterfrom
CyrusNajmabadi:fixWrappingSorting

Conversation

@CyrusNajmabadi
Copy link
Contributor

This regressed with #37894

The problem there is that you could have a wrapping item that was never invoke compared against one that was invoked. The non-invoked wrapping item would then show up with a negative index (because it wasn't in hte MRU list), but the invoked one would have a positive index. Negatie is less than positive. So the non-inokved one would now have priority!

We odn't have tests here. And that's on me. Will def add a test here to validate that this approach works.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner April 13, 2020 21:10
@CyrusNajmabadi CyrusNajmabadi force-pushed the fixWrappingSorting branch 2 times, most recently from 2332d78 to 68d4b98 Compare April 13, 2020 21:12
Copy link
Contributor Author

@CyrusNajmabadi CyrusNajmabadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c

// one of these has never been invoked. It's always after an item that has been
// invoked.
// we've invoked both of these before. Order by how recently it was invoked.
(ca, tuple) => tuple.Item1.IndexOf(GetSortTitle(ca)),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this approach just basically does not work. a non-invoked item will have a negative index, an invoked item will have a positive index.

Copy link
Member

@JoeRobich JoeRobich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approval

@ghost ghost merged commit 2ba8c96 into dotnet:master Apr 13, 2020
@CyrusNajmabadi CyrusNajmabadi deleted the fixWrappingSorting branch April 13, 2020 23:52
@jinujoseph jinujoseph added this to the 16.7.P1 milestone Apr 14, 2020
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants