Skip to content

Commit

Permalink
use some compound assignments (serilog#1732)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored and Twinki14 committed Dec 30, 2023
1 parent f91c8eb commit 9c3c71e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions test/Serilog.Tests/Debugging/SelfLogTests.cs
Expand Up @@ -18,7 +18,7 @@ public void MessagesAreWrittenWhenOutputIsSet()
Messages = new();
SelfLog.Enable(m =>
{
Messages = Messages ?? new();
Messages ??= new();
Messages.Add(m);
});

Expand All @@ -39,7 +39,7 @@ public void WritingToUndeclaredSinkWritesToSelfLog()
Messages = new();
SelfLog.Enable(m =>
{
Messages = Messages ?? new();
Messages ??= new();
Messages.Add(m);
});

Expand Down
2 changes: 1 addition & 1 deletion test/TestDummies/DummyRollingFileAuditSink.cs
Expand Up @@ -10,7 +10,7 @@ public class DummyRollingFileAuditSink : ILogEventSink
[ThreadStatic]
static List<LogEvent>? _emitted;

public static List<LogEvent> Emitted => _emitted ?? (_emitted = new());
public static List<LogEvent> Emitted => _emitted ??= new();

public void Emit(LogEvent logEvent)
{
Expand Down
2 changes: 1 addition & 1 deletion test/TestDummies/DummyRollingFileSink.cs
Expand Up @@ -10,7 +10,7 @@ public class DummyRollingFileSink : ILogEventSink
[ThreadStatic]
static List<LogEvent>? _emitted;

public static List<LogEvent> Emitted => _emitted ?? (_emitted = new());
public static List<LogEvent> Emitted => _emitted ??= new();

public void Emit(LogEvent logEvent)
{
Expand Down
2 changes: 1 addition & 1 deletion test/TestDummies/DummyWrappingSink.cs
Expand Up @@ -10,7 +10,7 @@ public class DummyWrappingSink : ILogEventSink
[ThreadStatic]
static List<LogEvent>? _emitted;

public static List<LogEvent> Emitted => _emitted ?? (_emitted = new());
public static List<LogEvent> Emitted => _emitted ??= new();

readonly ILogEventSink _sink;

Expand Down

0 comments on commit 9c3c71e

Please sign in to comment.