Skip to content

Commit

Permalink
PR feedback take 2
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirwin committed Dec 13, 2024
1 parent d388785 commit c435fb2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Lucene.Net/Support/Threading/AtomicDouble.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public static implicit operator double(AtomicDouble atomicInt64)
if (a2 is null)
return false;

return a1.Equals(a2.Value);
return a2.Equals(a1);
}

/// <summary>
Expand Down Expand Up @@ -411,10 +411,12 @@ public static implicit operator double(AtomicDouble atomicInt64)
/// <returns><c>true</c> if the given numbers are equal; otherwise, <c>false</c>.</returns>
public static bool operator ==(double? a1, AtomicDouble? a2)
{
if (!a1.HasValue)
if (a1 is null)
return a2 is null;
if (a2 is null)
return false;

return a1.GetValueOrDefault().Equals(a2.Value);
return a2.Equals(a1.Value);
}

/// <summary>
Expand Down

0 comments on commit c435fb2

Please sign in to comment.