Skip to content

Refactor reflection usage to only reflection against the one method#1199

Merged
AArnott merged 1 commit intomicrosoft:mainfrom
eerhardt:RemoveUnnecessaryReflection
Jun 13, 2025
Merged

Refactor reflection usage to only reflection against the one method#1199
AArnott merged 1 commit intomicrosoft:mainfrom
eerhardt:RemoveUnnecessaryReflection

Conversation

@eerhardt
Copy link
Copy Markdown
Member

Reflecting on all methods on the Type preserves all methods on the Type, which causes more code to be kept than is actually used in the app.

Instead, use a reflection pattern that targets the specific method being reflected on.

With the current code, all methods on JsonRpc are being preserved, causing things like Newtonsoft.Json to be kept in the app even though it is not used.

cc @AArnott

Reflecting on all methods on the Type preserves all methods on the Type, which causes more code to be kept than is actually used in the app.

Instead, use a reflection pattern that targets the specific method being reflected on.
@AArnott
Copy link
Copy Markdown
Member

AArnott commented Jun 13, 2025

/azp run

@AArnott AArnott enabled auto-merge June 13, 2025 22:36
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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