mschmidt00 commented on a change in pull request #1553:
URL: https://github.com/apache/tinkerpop/pull/1553#discussion_r793246908



##########
File path: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java
##########
@@ -78,25 +77,19 @@ public Compare negate() {
     },
 
     /**
-     * Evaluates if the first object is greater than the second. If both are 
of type {@link Number}, {@link NumberHelper}
-     * will be used for the comparison, thus enabling the comparison of only 
values, ignoring the number types.
+     * Evaluates if the first object is greater than the second per Gremlin 
Comparison semantics.
      *
      * @since 3.0.0-incubating
      */
     gt {
         @Override
         public boolean test(final Object first, final Object second) {
-            if (null != first && null != second) {
-                if (bothAreNumber(first, second)) {
-                    return NumberHelper.compare((Number) first, (Number) 
second) > 0;
-                }
-                if (bothAreComparableAndOfSameType(first, second)) {
-                    return ((Comparable) first).compareTo(second) > 0;
-                }
-                throwException(first, second);
-            }
-
-            return false;
+            // NaN takes precedence
+            if (eitherAreNaN(first, second))
+                throwTypeError();

Review comment:
       ack




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