Skip to content

Commit 668132a

Browse files
committed
Reuse TryComplete overload
1 parent 66df9b7 commit 668132a

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/Serilog.Extensions.Hosting/Extensions/Hosting/DiagnosticContextCollector.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,7 @@ public void SetException(Exception exception)
7171
/// <seealso cref="IDiagnosticContext.Set"/>
7272
public bool TryComplete(out IEnumerable<LogEventProperty> properties)
7373
{
74-
lock (_propertiesLock)
75-
{
76-
properties = _properties?.Values;
77-
_properties = null;
78-
_exception = null;
79-
Dispose();
80-
return properties != null;
81-
}
74+
return TryComplete(out properties, out _);
8275
}
8376

8477
/// <summary>

0 commit comments

Comments
 (0)