Skip to content

Conversation

@martincostello
Copy link
Member

Compute dates in DefaultKeyResolver once

Compute dates in DefaultKeyResolver once per LINQ query.

Description

Compute the maximum activation and creation DateTimeOffset for DefaultKeyResolver once before executing a LINQ query, rather than for each evaluation of where in the query.

Spotted while looking at #60049.

Compute the maximum activation and creation `DateTImeOffset` for `DefaultKeyResolver` once before executing a LINQ query, rather than for each evaluation of `where`.
@ghost ghost added the area-dataprotection Includes: DataProtection label Jan 27, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jan 27, 2025
Copy link
Member

@captainsafia captainsafia left a comment

Choose a reason for hiding this comment

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

Great change, @martincostello! Improves the readability of this code as well. 😄

@captainsafia captainsafia merged commit 6060ad1 into dotnet:main Jan 28, 2025
27 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview2 milestone Jan 28, 2025
@martincostello martincostello deleted the compute-dates-once branch January 28, 2025 07:38
captainsafia pushed a commit that referenced this pull request Feb 11, 2025
Compute the maximum activation and creation `DateTImeOffset` for `DefaultKeyResolver` once before executing a LINQ query, rather than for each evaluation of `where`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-dataprotection Includes: DataProtection community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants