]> git.sur5r.net Git - openldap/commitdiff
Use the first empty slot in the open cache table, so scan doesn't (usu
authorMark Valence <mrv@openldap.org>
Thu, 15 Jun 2000 17:48:16 +0000 (17:48 +0000)
committerMark Valence <mrv@openldap.org>
Thu, 15 Jun 2000 17:48:16 +0000 (17:48 +0000)
ally) have to look through the entire table.

servers/slapd/back-ldbm/dbcache.c

index ea3c3610c96f0f22d2fece825d06b9b580644f53..97b5a5e04b9067ad354ef5fc0e096bf2a13a9b2b 100644 (file)
@@ -62,7 +62,8 @@ ldbm_cache_open(
                for ( i = 0; i < MAXDBCACHE; i++ ) {
                        /* see if this slot is free */
                        if ( li->li_dbcache[i].dbc_name == NULL) {
-                               empty = i;
+                               if (empty == MAXDBCACHE)
+                                       empty = i;
                                continue;
                        }