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

BoundDecisionDag.Rewrite - Avoid capturing the replacement map #58137

Merged
merged 1 commit into from
Dec 8, 2021

Conversation

alrz
Copy link
Member

@alrz alrz commented Dec 6, 2021

Extracted from #57909

@alrz alrz requested a review from a team as a code owner December 6, 2021 20:16
@ghost ghost added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Dec 6, 2021
@@ -623,7 +623,7 @@ void storeToTemp(BoundDagTemp temp, BoundExpression expr)
}
}

BoundDecisionDagNode makeReplacement(BoundDecisionDagNode node, Func<BoundDecisionDagNode, BoundDecisionDagNode> replacement)
static BoundDecisionDagNode makeReplacement(BoundDecisionDagNode node, IReadOnlyDictionary<BoundDecisionDagNode, BoundDecisionDagNode> replacement)
Copy link
Member Author

Choose a reason for hiding this comment

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

Could be inlined as lambda for caching (this is the tuple input optimization which is common compared to rewrite for constant input)

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO when it comes to whether to use a lambda or to convert a local function to delegate, let's use whichever form we prefer to read, with the assumption that eventually the method group conversion to delegate caching will come about.

Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

LGTM (commit 1)

@AlekseyTs AlekseyTs enabled auto-merge (squash) December 8, 2021 16:27
@AlekseyTs AlekseyTs merged commit bbe3d03 into dotnet:main Dec 8, 2021
@ghost ghost added this to the Next milestone Dec 8, 2021
@AlekseyTs
Copy link
Contributor

@alrz Thank you for the contribution.

333fred added a commit to 333fred/roslyn that referenced this pull request Dec 10, 2021
…rations

* upstream/main: (396 commits)
  Update several ExpressionCompiler unit tests for inferred delegate types (dotnet#58203)
  Avoid calculating inferred delegate type unnecessarily in conversions and type inference (dotnet#58115)
  OmniSharp options (dotnet#58208)
  Fix generator caching in compiler server (dotnet#57177)
  Clarify use of null as an initialized value
  BoundDecisionDag.Rewrite - Avoid capturing the replacement map (dotnet#58137)
  Address feedback
  Add regex parser tests
  Add additional test for another bug report
  Add additional test for another bug report
  Add additional test for another bug report
  Add additional test for another bug report
  Add additional test for another bug report
  Add missing delegate casts (dotnet#58170)
  Add additional test for another bug report
  Add additional test for another bug report
  Add additional test for another bug report
  Add additional test for another bug report
  Add additional test for another bug report
  Add additional test for another bug report
  ...
@Cosifne Cosifne modified the milestones: Next, 17.1.P3 Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Community The pull request was submitted by a contributor who is not a Microsoft employee.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants