From af8b82332e1f8b9d09192c576b74310bb65ec7a8 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Tue, 19 Feb 2013 16:11:15 +0100 Subject: [PATCH] minor opt: avoid walking allterms if not needed: no stemlangs + stripchars --- src/rcldb/expansiondbs.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/rcldb/expansiondbs.cpp b/src/rcldb/expansiondbs.cpp index 742f9b67..3de4a964 100644 --- a/src/rcldb/expansiondbs.cpp +++ b/src/rcldb/expansiondbs.cpp @@ -45,6 +45,15 @@ bool createExpansionDbs(Xapian::WritableDatabase& wdb, // Erase and recreate all the expansion groups + // If langs is empty and we don't need casediac expansion, then no need to + // walk the big list + if (langs.empty()) { +#ifndef RCL_INDEX_STRIPCHARS + if (o_index_stripchars) +#endif + return true; + } + // Stem dbs vector stemdbs; // Note: tried to make this to work with stack-allocated objects, couldn't.