index: generalize pre-fetch paths

We already pre-fetched db file paths for the cleanup-case (since
cdb619e4f), now let's generalize this to all indexing.

For now this is mostly performance-neutral (lazy-rescan is slightly
faster); however, this simplifies the code.
This commit is contained in:
Dirk-Jan C. Binnema
2026-07-21 09:18:54 +03:00
committed by Seth Ladygo
parent 86464cd083
commit 7d60d2728a
5 changed files with 145 additions and 220 deletions

View File

@ -413,26 +413,6 @@ public:
*/
LabelsCache::Map label_map() const;
/**
* Prototype for the ForEachMessageFunc
*
* @param id :t store Id for the message
* @param path: the absolute path to the message
*
* @return true if for_each should continue; false to quit
*/
using ForEachMessageFunc = std::function<bool(Id, const std::string&)>;
/**
* Call @param func for each document in the store. This takes a lock on
* the store, so the func should _not_ call any other Store:: methods.
*
* @param func a Callable invoked for each message.
*
* @return the number of times func was invoked
*/
size_t for_each_message_path(ForEachMessageFunc func) const;
/**
* Prototype for the ForEachTermFunc
*