directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r580810 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoOpOptimizer.java
Date Sun, 30 Sep 2007 23:30:59 GMT
Author: elecharny
Date: Sun Sep 30 16:30:59 2007
New Revision: 580810

URL: http://svn.apache.org/viewvc?rev=580810&view=rev
Log:
Fixed a big bug in the NoOpOptimizer : the branches were not marked with the count

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoOpOptimizer.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoOpOptimizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoOpOptimizer.java?rev=580810&r1=580809&r2=580810&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoOpOptimizer.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoOpOptimizer.java
Sun Sep 30 16:30:59 2007
@@ -46,21 +46,19 @@
         }
         
         BranchNode bnode = ( BranchNode ) node;
+        
         if ( bnode.getChildren().size() == 0 )
         {
+            bnode.set( "count", MAX );
             return;
         }
         
-        if ( bnode.getChildren().size() == 1 )
-        {
-            bnode.getChildren().get( 0 ).set( "count", MAX );
-            return;
-        }
+        int limit = bnode.getChildren().size();
         
-        final int limit = bnode.getChildren().size();
         for ( int ii = 0; ii < limit; ii++ )
         {
             ExprNode child = bnode.getChildren().get( ii );
+            
             if ( child.isLeaf() )
             {
                 child.set( "count", MAX );
@@ -70,5 +68,7 @@
                 annotate( child );
             }
         }
+        
+        bnode.set( "count", MAX );
     }
 }



Mime
View raw message