]> git.sur5r.net Git - openldap/commitdiff
Stop reducing number of substring candiadates when there is only two or
authorKurt Zeilenga <kurt@openldap.org>
Sun, 12 Dec 1999 19:59:05 +0000 (19:59 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 12 Dec 1999 19:59:05 +0000 (19:59 +0000)
less left.  Based upon suggestion made by bert hubert <ahu@casema.net>

servers/slapd/back-bdb2/filterindex.c
servers/slapd/back-ldbm/filterindex.c

index 12d88d46c8f84a1508ed63779105be272217e9ea..1136661e44ebb0cbf9a54137b154f65684678fa6 100644 (file)
@@ -361,6 +361,14 @@ substring_comp_candidates(
                if( idl == NULL ) {
                        break;
                }
+
+               /* if we're down to two (or less) matches, stop searching */
+               if( ID_BLOCK_NIDS(idl) < 3 ) {
+                       Debug( LDAP_DEBUG_TRACE, "substring_comp_candidates: "
+                               "down to a %ld matches, stopped search\n",
+                                       (long) ID_BLOCK_NIDS(idl), 0, 0 );
+                       break;
+               }
        }
 
        Debug( LDAP_DEBUG_TRACE, "<= substring_comp_candidates %ld\n",
index 1cf5563a4014e7a38cbb395726e84fd287afafc9..97b2c87866f97041ed8a84339f71f8136240fdcf 100644 (file)
@@ -365,6 +365,14 @@ substring_comp_candidates(
                if( idl == NULL ) {
                        break;
                }
+
+               /* if we're down to two (or less) matches, stop searching */
+               if( ID_BLOCK_NIDS(idl) < 3 ) {
+                       Debug( LDAP_DEBUG_TRACE, "substring_comp_candiates: "
+                               "down to a %ld matches, stopped search\n",
+                                       (long) ID_BLOCK_NIDS(idl), 0, 0 );
+                       break;
+               }
        }
 
        Debug( LDAP_DEBUG_TRACE, "<= substring_comp_candidates %ld\n",