Commit af680490 authored by Howard Chu's avatar Howard Chu
Browse files

Eliminate unnecessary calls to slap_bv2ad

parent 130f6e1b
...@@ -144,6 +144,7 @@ done: ...@@ -144,6 +144,7 @@ done:
static int indexer( static int indexer(
Operation *op, Operation *op,
DB_TXN *txn, DB_TXN *txn,
AttributeDescription *ad,
struct berval *atname, struct berval *atname,
BerVarray vals, BerVarray vals,
ID id, ID id,
...@@ -153,7 +154,6 @@ static int indexer( ...@@ -153,7 +154,6 @@ static int indexer(
int rc, i; int rc, i;
const char *text; const char *text;
DB *db; DB *db;
AttributeDescription *ad = NULL;
struct berval *keys; struct berval *keys;
void *mark; void *mark;
...@@ -174,9 +174,6 @@ static int indexer( ...@@ -174,9 +174,6 @@ static int indexer(
return LDAP_OTHER; return LDAP_OTHER;
} }
rc = slap_bv2ad( atname, &ad, &text );
if( rc != LDAP_SUCCESS ) return rc;
mark = sl_mark(op->o_tmpmemctx); mark = sl_mark(op->o_tmpmemctx);
if( IS_SLAP_INDEX( mask, SLAP_INDEX_PRESENT ) ) { if( IS_SLAP_INDEX( mask, SLAP_INDEX_PRESENT ) ) {
...@@ -259,6 +256,7 @@ done: ...@@ -259,6 +256,7 @@ done:
static int index_at_values( static int index_at_values(
Operation *op, Operation *op,
DB_TXN *txn, DB_TXN *txn,
AttributeDescription *ad,
AttributeType *type, AttributeType *type,
struct berval *tags, struct berval *tags,
BerVarray vals, BerVarray vals,
...@@ -270,7 +268,7 @@ static int index_at_values( ...@@ -270,7 +268,7 @@ static int index_at_values(
if( type->sat_sup ) { if( type->sat_sup ) {
/* recurse */ /* recurse */
rc = index_at_values( op, txn, rc = index_at_values( op, txn, NULL,
type->sat_sup, tags, type->sat_sup, tags,
vals, id, opid ); vals, id, opid );
...@@ -280,10 +278,11 @@ static int index_at_values( ...@@ -280,10 +278,11 @@ static int index_at_values(
/* If this type has no AD, we've never used it before */ /* If this type has no AD, we've never used it before */
if( type->sat_ad ) { if( type->sat_ad ) {
bdb_attr_mask( op->o_bd->be_private, type->sat_ad, &mask ); bdb_attr_mask( op->o_bd->be_private, type->sat_ad, &mask );
ad = type->sat_ad;
} }
if( mask ) { if( mask ) {
rc = indexer( op, txn, &type->sat_cname, rc = indexer( op, txn, ad, &type->sat_cname,
vals, id, opid, vals, id, opid,
mask ); mask );
...@@ -301,7 +300,7 @@ static int index_at_values( ...@@ -301,7 +300,7 @@ static int index_at_values(
} }
if( mask ) { if( mask ) {
rc = indexer( op, txn, &desc->ad_cname, rc = indexer( op, txn, desc, &desc->ad_cname,
vals, id, opid, vals, id, opid,
mask ); mask );
...@@ -324,7 +323,7 @@ int bdb_index_values( ...@@ -324,7 +323,7 @@ int bdb_index_values(
{ {
int rc; int rc;
rc = index_at_values( op, txn, rc = index_at_values( op, txn, desc,
desc->ad_type, &desc->ad_tags, desc->ad_type, &desc->ad_tags,
vals, id, opid ); vals, id, opid );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment