0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd:Ⓜ️ ADL the event::fetch::index() suite.

This commit is contained in:
Jason Volk 2018-05-09 16:38:11 -07:00
parent 369582339a
commit c14f268559
5 changed files with 26 additions and 26 deletions

View file

@ -192,10 +192,10 @@ struct ircd::m::event::fetch
static bool event_id(const idx &, std::nothrow_t, const id::closure &);
static void event_id(const idx &, const id::closure &);
static idx index(const id &, std::nothrow_t);
static idx index(const id &);
static idx index(const event &, std::nothrow_t);
static idx index(const event &);
friend idx index(const id &, std::nothrow_t);
friend idx index(const id &);
friend idx index(const event &, std::nothrow_t);
friend idx index(const event &);
friend bool seek(fetch &, const idx &, std::nothrow_t);
friend void seek(fetch &, const idx &);

View file

@ -559,7 +559,7 @@ ircd::m::event::event(const id &id,
const mutable_buffer &buf)
:event
{
fetch::index(id), buf
index(id), buf
}
{
}
@ -1210,9 +1210,9 @@ ircd::m::seek(event::fetch &fetch,
const event::id &event_id,
std::nothrow_t)
{
const event::idx &event_idx
const auto &event_idx
{
event::fetch::index(event_id, std::nothrow)
index(event_id, std::nothrow)
};
return seek(fetch, event_idx, std::nothrow);
@ -1250,20 +1250,20 @@ ircd::m::seek(event::fetch &fetch,
}
ircd::m::event::idx
ircd::m::event::fetch::index(const event &event)
ircd::m::index(const event &event)
{
return index(at<"event_id"_>(event));
}
ircd::m::event::idx
ircd::m::event::fetch::index(const event &event,
std::nothrow_t)
ircd::m::index(const event &event,
std::nothrow_t)
{
return index(at<"event_id"_>(event), std::nothrow);
}
ircd::m::event::idx
ircd::m::event::fetch::index(const id &event_id)
ircd::m::index(const event::id &event_id)
{
auto &column
{
@ -1281,8 +1281,8 @@ ircd::m::event::fetch::index(const id &event_id)
}
ircd::m::event::idx
ircd::m::event::fetch::index(const id &event_id,
std::nothrow_t)
ircd::m::index(const event::id &event_id,
std::nothrow_t)
{
auto &column
{

View file

@ -464,7 +464,7 @@ ircd::m::room::messages::seek(const event::id &event_id)
const event::idx event_idx
{
event::fetch::index(event_id)
index(event_id)
};
uint64_t depth;
@ -669,7 +669,7 @@ const try
m::state::get(root_id, type, state_key, [&closure]
(const string_view &event_id)
{
closure(event::fetch::index(unquote(event_id)));
closure(index(unquote(event_id)));
});
auto &column{dbs::room_state};
@ -743,7 +743,7 @@ const
return m::state::get(std::nothrow, root_id, type, state_key, [&closure]
(const string_view &event_id)
{
return closure(event::fetch::index(unquote(event_id), std::nothrow));
return closure(index(unquote(event_id), std::nothrow));
});
auto &column{dbs::room_state};
@ -868,7 +868,7 @@ const
return m::state::test(root_id, [&closure]
(const json::array &key, const string_view &event_id)
{
return closure(event::fetch::index(unquote(event_id), std::nothrow));
return closure(index(unquote(event_id), std::nothrow));
});
auto &column{dbs::room_state};
@ -931,7 +931,7 @@ const
return m::state::test(root_id, type, [&closure]
(const json::array &key, const string_view &event_id)
{
return closure(event::fetch::index(unquote(event_id), std::nothrow));
return closure(index(unquote(event_id), std::nothrow));
});
char keybuf[dbs::ROOM_STATE_KEY_MAX_SIZE];
@ -1045,7 +1045,7 @@ const
return m::state::test(root_id, type, state_key_lb, [&closure]
(const json::array &key, const string_view &event_id)
{
return closure(event::fetch::index(unquote(event_id), std::nothrow));
return closure(index(unquote(event_id), std::nothrow));
});
char keybuf[dbs::ROOM_STATE_KEY_MAX_SIZE];
@ -1105,7 +1105,7 @@ const
return m::state::for_each(root_id, [&closure]
(const json::array &key, const string_view &event_id)
{
closure(event::fetch::index(unquote(event_id), std::nothrow));
closure(index(unquote(event_id), std::nothrow));
});
auto &column{dbs::room_state};
@ -1155,7 +1155,7 @@ const
return m::state::for_each(root_id, type, [&closure]
(const json::array &key, const string_view &event_id)
{
closure(event::fetch::index(unquote(event_id), std::nothrow));
closure(index(unquote(event_id), std::nothrow));
});
char keybuf[dbs::ROOM_STATE_KEY_MAX_SIZE];

View file

@ -158,12 +158,12 @@ try
const m::event::idx &previous_idx
{
m::event::fetch::index(previous_id)
index(previous_id)
};
const m::event::idx &event_idx
{
m::event::fetch::index(event_id)
index(event_id)
};
ret = event_idx > previous_idx;

View file

@ -695,7 +695,7 @@ polylog_sync_account_data(shortpoll &sp,
{
const auto &event_idx
{
m::event::fetch::index(event)
index(event)
};
if(event_idx < sp.since || event_idx >= sp.current)
@ -873,7 +873,7 @@ polylog_sync_room_state(shortpoll &sp,
const auto &event_idx
{
m::event::fetch::index(event)
index(event)
};
if(event_idx < sp.since || event_idx >= sp.current)
@ -1000,7 +1000,7 @@ polylog_sync_room_ephemeral_events(shortpoll &sp,
{
const auto &event_idx
{
m::event::fetch::index(event)
index(event)
};
if(event_idx < sp.since || event_idx >= sp.current)