jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1489367 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
Date Tue, 04 Jun 2013 10:14:10 GMT
Author: thomasm
Date: Tue Jun  4 10:14:09 2013
New Revision: 1489367

URL: http://svn.apache.org/r1489367
Log:
OAK-853 Many child nodes: Diffing causes many calls to MicroKernel.diff

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java?rev=1489367&r1=1489366&r2=1489367&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
Tue Jun  4 10:14:09 2013
@@ -394,7 +394,14 @@ public final class KernelNodeState exten
                         // definitively different.
                         return true;
                     } else if (path.equals(that.path) && !path.equals("/")) {
-                        String jsonDiff = kernel.diff(that.getRevision(), revision, path,
0);
+                        String r1 = revision, r2 = that.getRevision();
+                        if (r1.compareTo(r2) > 0) {
+                            // sort the revisions, to allow the MicroKernel to cache the
result
+                            String temp = r1;
+                            r1 = r2;
+                            r2 = temp;
+                        }
+                        String jsonDiff = kernel.diff(r1, r2, path, 0);
                         return !hasChanges(jsonDiff);
                     }
                 }



Mime
View raw message