store: don't lock for_each_term

It's only called from the parser with a store, and when we _already_
hold the lock.
This commit is contained in:
Dirk-Jan C. Binnema 2022-02-05 08:44:43 +02:00
parent 6becc657c1
commit 77bca5463f
1 changed files with 4 additions and 2 deletions

View File

@ -610,8 +610,10 @@ Store::for_each_term(const std::string& field, Store::ForEachTermFunc func) cons
size_t n{};
xapian_try([&] {
std::lock_guard guard{priv_->lock_};
const auto id = field_id(field.c_str());
/*
* Do _not_ take a lock; this is only called from
* the message parser which already has the lock */
const auto id = field_id(field.c_str());
if (id == MU_MSG_FIELD_ID_NONE)
return;