You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2007/10/01 01:30:59 UTC
svn commit: r580810 -
/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoOpOptimizer.java
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 );
}
}