From 93a622d5e1557ad4e4ac555f33b0d9e2bcffd284 Mon Sep 17 00:00:00 2001 From: Mark Valence Date: Thu, 15 Jun 2000 17:48:16 +0000 Subject: [PATCH] Use the first empty slot in the open cache table, so scan doesn't (usu ally) have to look through the entire table. --- servers/slapd/back-ldbm/dbcache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.39.5