Skip to content

Commit 0a9a0fb

Browse files
committed
Update RefCountedValue to support proper nullability attributes for net5.0 and above.
1 parent e86f251 commit 0a9a0fb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/ImageSharp.Web/Synchronization/RefCountedConcurrentDictionary.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,13 @@ public RefCountedValue(TValue value, int refCount)
227227
}
228228

229229
public bool Equals(
230-
#if NETCOREAPP3_1_OR_GREATER
231-
[System.Diagnostics.CodeAnalysis.AllowNull]
232-
#endif
230+
#if NET5_0_OR_GREATER
231+
RefCountedValue? other)
232+
#elif NETCOREAPP3_1_OR_GREATER
233+
[System.Diagnostics.CodeAnalysis.AllowNull] RefCountedValue other)
234+
#else
233235
RefCountedValue other)
236+
#endif
234237
=> (other != null) && (this.RefCount == other.RefCount) && EqualityComparer<TValue>.Default.Equals(this.Value, other.Value);
235238

236239
public override bool Equals(object? obj)

0 commit comments

Comments
 (0)