summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-01-11 12:18:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:40:22 -0500
commit930fca1c9728f5ba1f9f3bff003c23c508960c2d (patch)
treea421fa376c00fe65fdfabc201f60a6fb457fdf8f /source4/lib/ldb/ldb_tdb
parentbd96c74e144262643d3edb899c68583765ee0865 (diff)
downloadsamba-930fca1c9728f5ba1f9f3bff003c23c508960c2d.tar.gz
samba-930fca1c9728f5ba1f9f3bff003c23c508960c2d.tar.bz2
samba-930fca1c9728f5ba1f9f3bff003c23c508960c2d.zip
r20684: if we don't have any indexes, then we should not waste time
to traverse the whole tdb and unpack each record metze (This used to be commit 492c79de13eab8db6079f880a8f0857dc7a29fa8)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index fd61d41037..f6dc997f3a 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -1323,6 +1323,11 @@ int ltdb_reindex(struct ldb_module *module)
return -1;
}
+ /* if we don't have indexes we have nothing todo */
+ if (ltdb->cache->indexlist->num_elements == 0) {
+ return 0;
+ }
+
/* now traverse adding any indexes for normal LDB records */
ret = tdb_traverse(ltdb->tdb, re_index, module);
if (ret == -1) {