-
Notifications
You must be signed in to change notification settings - Fork 615
use cached empty BasicProperties when null #887
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
Conversation
|
Makes perfect sense to me. Thank you! |
use cached empty BasicProperties when null (cherry picked from commit 772dc4d)
|
Backported to |
|
Just because I think it's fine now but it could introduce some bugs later if the some code decide to make modifications to the properties they receive and thus your https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/readonly
|
|
The cached object is only used when sending data and no properties have been set, so it should never be able to be modified, except through reflection. |
Proposed Changes
Instead of creating a new BasicProperties when the passed one is null, a cached empty one is used. This avoids creating a new instance every time.
Types of Changes
Checklist
CONTRIBUTING.mddocumentFurther Comments
edited as I accidentally posted it too early