/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2005 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
};
static Avlnode *oc_index = NULL;
+static Avlnode *oc_cache = NULL;
static LDAP_SLIST_HEAD(OCList, slap_object_class) oc_list
= LDAP_SLIST_HEAD_INITIALIZER(&oc_list);
{
struct oindexrec *oir;
+ if ( oc_cache ) {
+ oir = avl_find( oc_cache, ocname, oc_index_name_cmp );
+ if ( oir ) return oir->oir_oc;
+ }
oir = avl_find( oc_index, ocname, oc_index_name_cmp );
if ( oir != NULL ) {
+ if ( at_oc_cache ) {
+ avl_insert( &oc_cache, (caddr_t) oir,
+ oc_index_cmp, avl_dup_error );
+ }
return( oir->oir_oc );
}