Skip to content

Commit a74073c

Browse files
committed
Migration to pattern matching
1 parent d2edd05 commit a74073c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/DotNext/Runtime/SoftReference.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ private sealed class Tracker(SoftReference<T> parent, SoftReferenceOptions optio
2424
~Tracker()
2525
{
2626
// Thread safety: preserve order of fields
27-
var target = parent.strongRef;
28-
var thisRef = parent.trackerRef;
29-
30-
if (target is null || thisRef is null)
27+
if (parent.strongRef is not { } target || parent.trackerRef is not { } thisRef)
3128
{
3229
// do nothing
3330
}

0 commit comments

Comments
 (0)