commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r552593 - /jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/NodePointer.java
Date Mon, 02 Jul 2007 20:54:37 GMT
Author: mbenson
Date: Mon Jul  2 13:54:36 2007
New Revision: 552593

URL: http://svn.apache.org/viewvc?view=rev&rev=552593
Log:
loc refactor

Modified:
    jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/NodePointer.java

Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/NodePointer.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/NodePointer.java?view=diff&rev=552593&r1=552592&r2=552593
==============================================================================
--- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/NodePointer.java
(original)
+++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/NodePointer.java
Mon Jul  2 13:54:36 2007
@@ -653,23 +653,12 @@
             int r = compareNodePointers(p1.parent, depth1 - 1, p2, depth2);
             return r == 0 ? 1 : r;
         }
-        if (p1 == null && p2 == null) {
-            return 0;
-        }
-
-        if (p1 != null && p1.equals(p2)) {
-            return 0;
-        }
-
-        if (depth1 == 1) {
+        //henceforth depth1 == depth2:
+        if (depth1 == 1 || p1 == p2 || p1 != null && p1.equals(p2)) {
             return 0;
         }
         int r = compareNodePointers(p1.parent, depth1 - 1, p2.parent, depth2 - 1);
-        if (r != 0) {
-            return r;
-        }
-
-        return p1.parent.compareChildNodePointers(p1, p2);
+        return r == 0 ? p1.parent.compareChildNodePointers(p1, p2) : r;
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message