mu-query: minor cleanups

This commit is contained in:
Dirk-Jan C. Binnema
2024-05-08 00:06:28 +03:00
parent c3283dc5ae
commit ceed832cb9
2 changed files with 4 additions and 22 deletions

View File

@ -18,27 +18,15 @@
*/
#include <mu-query.hh>
#include <stdexcept>
#include <string>
#include <cctype>
#include <cstring>
#include <sstream>
#include <cmath>
#include <stdlib.h>
#include <glib/gstdio.h>
#include "mu-xapian-db.hh"
#include "mu-query-results.hh"
#include "mu-query-match-deciders.hh"
#include "mu-query-threads.hh"
#include "mu-query-parser.hh"
using namespace Mu;
struct Query::Private {
Private(const Store& store) :
explicit Private(const Store& store) :
store_{store},
parser_flags_{any_of(store_.message_options() & Message::Options::SupportNgrams) ?
ParserFlags::SupportNgrams : ParserFlags::None} {}
@ -125,7 +113,7 @@ Query::Private::make_related_enquire(const StringSet& thread_ids,
}
struct ThreadKeyMaker : public Xapian::KeyMaker {
ThreadKeyMaker(const QueryMatches& matches) : match_info_(matches) {}
explicit ThreadKeyMaker(const QueryMatches& matches) : match_info_(matches) {}
std::string operator()(const Xapian::Document& doc) const override {
const auto it{match_info_.find(doc.get_docid())};
return (it == match_info_.end()) ? "" : it->second.thread_path;