blankensteiner commented on a change in pull request #50:
URL: https://github.com/apache/pulsar-dotpulsar/pull/50#discussion_r480917670



##########
File path: src/DotPulsar/MessageId.cs
##########
@@ -76,13 +76,13 @@ public override bool Equals(object o)
             => o is MessageId id && Equals(id);
 
         public bool Equals(MessageId other)
-            => LedgerId == other.LedgerId && EntryId == other.EntryId && 
Partition == other.Partition && BatchIndex == other.BatchIndex;
+            => !(other is null) && LedgerId == other.LedgerId && EntryId == 
other.EntryId && Partition == other.Partition && BatchIndex == other.BatchIndex;
 
         public static bool operator ==(MessageId x, MessageId y)
-            => x.Equals(y);
+            => object.ReferenceEquals(x, y) || (!object.ReferenceEquals(x, 
null) && x.Equals(y));

Review comment:
       Just curious but why "!object.ReferenceEquals(x, null)" instead of "!(x 
is null)" or "x != null"?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to