Skip to content

Commit 7706ac6

Browse files
committed
exmdb: move ID_ARRAYS type into struct db_conn
1 parent e821a90 commit 7706ac6

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

exch/exmdb/db_engine.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,6 @@ struct POPULATING_NODE {
6868
LONGLONG_ARRAY folder_ids{};
6969
};
7070

71-
struct xless {
72-
bool operator()(const char *a, const char *b) const {
73-
return b == nullptr ? false : a == nullptr ? true :
74-
strcasecmp(a, b) < 0;
75-
}
76-
};
77-
using ID_ARRAYS = std::map<const char *, std::vector<uint32_t>, xless>;
78-
7971
struct ROWINFO_NODE {
8072
DOUBLE_LIST_NODE node;
8173
BOOL b_added;
@@ -685,10 +677,10 @@ POPULATING_NODE::~POPULATING_NODE()
685677
free(folder_ids.pll);
686678
}
687679

688-
static ID_ARRAYS db_engine_classify_id_array(const db_base &db,
680+
static db_conn::ID_ARRAYS db_engine_classify_id_array(const db_base &db,
689681
unsigned int bits, uint64_t folder_id, uint64_t message_id) try
690682
{
691-
ID_ARRAYS out;
683+
db_conn::ID_ARRAYS out;
692684
for (const auto &sub : db.nsub_list) {
693685
if (!(sub.notification_type & bits))
694686
continue;
@@ -702,7 +694,7 @@ static ID_ARRAYS db_engine_classify_id_array(const db_base &db,
702694
throw;
703695
}
704696

705-
static void dg_notify(DB_NOTIFY_DATAGRAM &&dg, ID_ARRAYS &&a)
697+
static void dg_notify(DB_NOTIFY_DATAGRAM &&dg, db_conn::ID_ARRAYS &&a)
706698
{
707699
for (auto &&[remote_id, sub_ids] : a) {
708700
dg.id_array = std::move(sub_ids);

exch/exmdb/db_engine.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <atomic>
33
#include <cstdint>
44
#include <list>
5+
#include <map>
56
#include <memory>
67
#include <mutex>
78
#include <shared_mutex>
@@ -160,6 +161,14 @@ using db_base_wr_ptr = std::unique_ptr<db_base, db_base_unlock_wr>;
160161

161162
class db_item_deleter;
162163
struct db_conn {
164+
struct xless {
165+
bool operator()(const char *a, const char *b) const {
166+
return b == nullptr ? false : a == nullptr ? true :
167+
strcasecmp(a, b) < 0;
168+
}
169+
};
170+
using ID_ARRAYS = std::map<const char *, std::vector<uint32_t>, xless>;
171+
163172
db_conn(db_base &);
164173
~db_conn();
165174
db_conn(db_conn &&);

0 commit comments

Comments
 (0)