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

No boxing for structs #22030

Merged
merged 7 commits into from
Aug 14, 2020
Merged

No boxing for structs #22030

merged 7 commits into from
Aug 14, 2020

Conversation

SergerGood
Copy link
Contributor

No description provided.

Copy link
Member

@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.

Thanks! Apart from the minor indentation issue this looks good.

It's also possible to simplify the Equals(object) method to something like the following, if you feel like doing that in this PR:

public override bool Equals(object obj)
    => obj is CompiledQueryCacheKey other && Equals(other)

src/EFCore/Query/CompiledQueryCacheKeyGenerator.cs Outdated Show resolved Hide resolved
@roji
Copy link
Member

roji commented Aug 13, 2020

Looks good, thanks! Two other structs which come to mind here are StoreObjectIdentifier (used as Dictionary key here), ValueBuffer which already has Equals. @AndriySvyryd may have other ideas.

If you're uncomfortable with any of these of prefer to scope them out, just say so.

@SergerGood
Copy link
Contributor Author

Oops) StoreObjectIdentifier added by someone.
And ValueBuffer added in this commit already.

@roji roji merged commit 7840f8b into dotnet:main Aug 14, 2020
@roji
Copy link
Member

roji commented Aug 14, 2020

Thanks for this contribution @SergerGood!

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.

3 participants