Skip to content

Commit

Permalink
use field keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Nov 14, 2024
1 parent d2ffdb0 commit 9a79e2a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Argon/Utilities/CollectionWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class CollectionWrapper<T> : ICollection<T>, IWrappedCollection
{
readonly IList list;
readonly ICollection<T> genericCollection;
object syncRoot;

public CollectionWrapper(IList list)
{
Expand Down Expand Up @@ -222,12 +221,12 @@ object ICollection.SyncRoot
{
get
{
if (syncRoot == null)
if (field == null)
{
Interlocked.CompareExchange(ref syncRoot, new(), null);
Interlocked.CompareExchange(ref field, new(), null);
}

return syncRoot;
return field;
}
}

Expand Down

0 comments on commit 9a79e2a

Please sign in to comment.