Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve collection indexer normalization #30780

Merged
merged 3 commits into from
Apr 29, 2023
Merged

Improve collection indexer normalization #30780

merged 3 commits into from
Apr 29, 2023

Conversation

roji
Copy link
Member

@roji roji commented Apr 27, 2023

Improve array.Length->Count() normalization

  • Move normalization of array.Length to Count() from nav expansion to normalization step.
  • Also normalize array.LongLength.

Improve indexer->ElementAt normalization

  • Perform the normalization for core, not just for relational.
  • Integrate it into QueryableMethodNormalizingExpressionVisitor
  • Perform it on indexers on any type that implements IReadOnlyList<>, not just List.

* Perform the normalization for core, not just for relational.
* Integrate it into QueryableMethodNormalizingExpressionVisitor
* Perform it on indexers on any type that implements IReadOnlyList<>,
  not just List.
* Move normalization of array.Length to Count() from nav expansion
  to normalization step.
* Also normalize array.LongLength.
@roji roji requested a review from maumar April 27, 2023 13:43
Copy link
Member Author

@roji roji left a comment

Choose a reason for hiding this comment

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

@maumar I looked at this again and decided to shelve the ArrayLength changes; I think they're generally good, but it's a bit of extra complexity for no immediate again.

I've put this in a branch, will maybe revisit at some later point...

@roji roji changed the title Work on collection indexer/length normalization Improve collection indexer normalization Apr 29, 2023
@roji roji merged commit b3f6692 into dotnet:main Apr 29, 2023
@roji roji deleted the Normalization branch April 29, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants