Skip to content

Commit

Permalink
mu-query: minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
djcb committed May 7, 2024
1 parent c3283dc commit ceed832
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
16 changes: 2 additions & 14 deletions lib/mu-query.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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} {}
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 2 additions & 8 deletions lib/mu-query.hh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Copyright (C) 2008-2023 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** Copyright (C) 2008-2024 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
Expand All @@ -20,9 +20,9 @@
#ifndef __MU_QUERY_HH__
#define __MU_QUERY_HH__

#include <string>
#include <memory>

#include <glib.h>
#include <mu-store.hh>
#include <mu-query-results.hh>
#include <utils/mu-utils.hh>
Expand Down Expand Up @@ -86,12 +86,6 @@ private:
*/
~Query();

/**
* Move CTOR
*
* @param other
*/

struct Private;
std::unique_ptr<Private> priv_;
};
Expand Down

0 comments on commit ceed832

Please sign in to comment.