From 930fca1c9728f5ba1f9f3bff003c23c508960c2d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 11 Jan 2007 12:18:17 +0000 Subject: 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) --- source4/lib/ldb/ldb_tdb/ldb_index.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/lib/ldb') 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) { -- cgit