From: Mark Valence Date: Thu, 15 Jun 2000 17:48:16 +0000 (+0000) Subject: Use the first empty slot in the open cache table, so scan doesn't (usu X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2634 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=93a622d5e1557ad4e4ac555f33b0d9e2bcffd284;p=openldap Use the first empty slot in the open cache table, so scan doesn't (usu ally) have to look through the entire table. --- diff --git a/servers/slapd/back-ldbm/dbcache.c b/servers/slapd/back-ldbm/dbcache.c index ea3c3610c9..97b5a5e04b 100644 --- a/servers/slapd/back-ldbm/dbcache.c +++ b/servers/slapd/back-ldbm/dbcache.c @@ -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; }