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

AVRO-3893: Avoid unnecessary lambda capture on each invocation of 'ObjectCreator.FindType' #2565

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jbit84
Copy link

@jbit84 jbit84 commented Oct 24, 2023

What is the purpose of the change

The pull request reduces object allocations by removing an unnecessary lambda capture, thus turning a capturing lambda into a non-capturing lambda.

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

ObjectCreator.FindType is transitively invoked by many existing unit test, for example tests in 'ObjectCreatorTests' and 'FileTests'.

Documentation

This pull request does not introduce a new feature.

…ndType' by instead using the key-value passed to the Func<string, Type> lambda from the GetOrAdd invocation.
@github-actions github-actions bot added the C# label Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant