summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Colascione <dancol@dancol.org>2026-02-16 22:38:29 -0500
committerDaniel Colascione <dancol@dancol.org>2026-02-16 22:39:47 -0500
commit474a0ecc5294fb09ffd24cb5e55f744522f3e7f0 (patch)
treeaefdaca41d8f54c834e7c8eee983cb55baf1d66d
parentb0a6ae57e56f37f33ced31ccdfc74e0715980632 (diff)
Work around xapian bug
https://trac.xapian.org/ticket/850
-rw-r--r--lib/mu-store.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/mu-store.cc b/lib/mu-store.cc
index de061ac..1e50f2b 100644
--- a/lib/mu-store.cc
+++ b/lib/mu-store.cc
@@ -477,7 +477,11 @@ Store::remove_messages_by_term(std::span<const std::string> terms,
enq.set_docid_order(Xapian::Enquire::ASCENDING);
enq.set_query(Xapian::Query{Xapian::Query::OP_OR, qvec.begin(), qvec.end()});
auto mset = enq.get_mset(0, xapian_db().size());
- ids_to_remove.insert(ids_to_remove.end(), mset.begin(), mset.end());
+ // Work around Xapian MSetIterator trait mismatch:
+ // https://trac.xapian.org/ticket/850
+ ids_to_remove.reserve(ids_to_remove.size() + mset.size());
+ for (auto it = mset.begin(); it != mset.end(); ++it)
+ ids_to_remove.push_back(*it);
}
// Sort the IDs to remove to make Xapian tree traversal easier