This is instead of checking the number of elements via ltdb->cache->indexlist->num_elements
In turn, this allows us to avoid fetching ltdb->cache->indexlist in the future
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
unsigned int i;
struct ldb_message_element *el;
+ if (!ltdb->cache->attribute_indexes) {
+ return false;
+ }
+
el = ldb_msg_find_element(ltdb->cache->indexlist, LTDB_IDXATTR);
if (el == NULL) {
return false;
return LDB_SUCCESS;
}
- if (ltdb->cache->indexlist->num_elements == 0) {
+ if (!ltdb->cache->attribute_indexes) {
/* no indexed fields */
return LDB_SUCCESS;
}
}
/* if we don't have indexes we have nothing todo */
- if (ltdb->cache->indexlist->num_elements == 0) {
+ if (!ltdb->cache->attribute_indexes) {
return LDB_SUCCESS;
}