r20684: if we don't have any indexes, then we should not waste time
authorStefan Metzmacher <metze@samba.org>
Thu, 11 Jan 2007 12:18:17 +0000 (12:18 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:40:22 +0000 (14:40 -0500)
to traverse the whole tdb and unpack each record

metze

source/lib/ldb/ldb_tdb/ldb_index.c

index fd61d410375c4cee813559323767cda925f7cac2..f6dc997f3a50aa930611854ca1f427efc6ca2c5c 100644 (file)
@@ -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) {