KyleSchoonover commented on code in PR #1653:
URL: https://github.com/apache/avro/pull/1653#discussion_r854368702


##########
lang/csharp/src/apache/main/Generic/GenericEnum.cs:
##########
@@ -70,10 +70,12 @@ public GenericEnum(EnumSchema schema, string value)
         /// <inheritdoc/>
         public override bool Equals(object obj)
         {
-            if (obj == this) return true;
-            return (obj != null && obj is GenericEnum)
-                ? Value.Equals((obj as GenericEnum).Value, 
System.StringComparison.Ordinal)
-                : false;
+            if (obj == this)
+            {
+                return true;
+            }
+
+            return obj != null && obj is GenericEnum && Value.Equals((obj as 
GenericEnum).Value, System.StringComparison.Ordinal);
         }

Review Comment:
   It's an interesting problem: 
https://codeql.github.com/codeql-query-help/csharp/cs-equals-uses-is/
   
   Updating the code.  I will evaluate the code base after this PR.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to