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

Introduce ScalarValue.Null #1774

Merged
merged 4 commits into from
Dec 14, 2022
Merged

Introduce ScalarValue.Null #1774

merged 4 commits into from
Dec 14, 2022

Conversation

sungam3r
Copy link
Contributor

@sungam3r sungam3r commented Dec 2, 2022

Saves some allocations.

Co-authored-by: Ivan Maximov <sungam3r@yandex.ru>
Copy link
Member

@nblumhardt nblumhardt left a comment

Choose a reason for hiding this comment

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

Nice! Seems like a low-risk win 👍

My only thought was whether there'd be any advantage to keeping the static property entirely internal, but seems reasonable to expose it and encourage similar usage in other places.

true and false might also be good candidates for this treatment.

@sungam3r
Copy link
Contributor Author

sungam3r commented Dec 3, 2022

I can add cached common values in another pr.

Copy link
Member

@augustoproiete augustoproiete left a comment

Choose a reason for hiding this comment

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

LGTM

src/Serilog/Events/ScalarValue.cs Outdated Show resolved Hide resolved
Co-authored-by: C. Augusto Proiete <augusto@proiete.com>
@@ -409,6 +410,7 @@ namespace Serilog.Events
{
public SequenceValue(System.Collections.Generic.IEnumerable<Serilog.Events.LogEventPropertyValue> elements) { }
public System.Collections.Generic.IReadOnlyList<Serilog.Events.LogEventPropertyValue> Elements { get; }
public static Serilog.Events.SequenceValue Empty { get; }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nblumhardt I pulled changes from dev to fix approval file after merging #1785.

@nblumhardt nblumhardt merged commit d5cecf3 into serilog:dev Dec 14, 2022
@sungam3r sungam3r deleted the opt branch December 15, 2022 19:30
@nblumhardt nblumhardt mentioned this pull request Jun 19, 2023
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.

None yet

4 participants