diff --git a/include/ircd/m/event/index.h b/include/ircd/m/event/index.h index 1932e76fa..d4795392c 100644 --- a/include/ircd/m/event/index.h +++ b/include/ircd/m/event/index.h @@ -13,11 +13,11 @@ namespace ircd::m { - bool index(const event::id &, std::nothrow_t, const event::closure_idx &); + bool index(std::nothrow_t, const event::id &, const event::closure_idx &); - event::idx index(const event::id &, std::nothrow_t); + event::idx index(std::nothrow_t, const event::id &); event::idx index(const event::id &); - event::idx index(const event &, std::nothrow_t); + event::idx index(std::nothrow_t, const event &); event::idx index(const event &); } diff --git a/include/ircd/m/redacted.h b/include/ircd/m/redacted.h index d4f832c83..444c641a8 100644 --- a/include/ircd/m/redacted.h +++ b/include/ircd/m/redacted.h @@ -38,7 +38,7 @@ inline ircd::m::redacted::redacted(const event::id &event_id) :redacted { - index(event_id, std::nothrow) + index(std::nothrow, event_id) } {} diff --git a/matrix/dbs.cc b/matrix/dbs.cc index ef374755e..f056eb205 100644 --- a/matrix/dbs.cc +++ b/matrix/dbs.cc @@ -398,7 +398,7 @@ ircd::m::dbs::find_event_idx(const event::id &event_id, ret = wopts.interpose->val(db::op::SET, "_event_idx", event_id, 0UL); if(wopts.allow_queries && !ret) - ret = m::index(event_id, std::nothrow); // query + ret = m::index(std::nothrow, event_id); // query return ret; } diff --git a/matrix/event.cc b/matrix/event.cc index 541e18c8c..f852b5fb6 100644 --- a/matrix/event.cc +++ b/matrix/event.cc @@ -991,7 +991,7 @@ bool ircd::m::bad(const id::event &event_id) { bool ret {false}; - index(event_id, std::nothrow, [&ret] + index(std::nothrow, event_id, [&ret] (const event::idx &event_idx) { ret = event_idx == 0; @@ -1016,7 +1016,7 @@ ircd::m::count(const event::prev &prev) bool ircd::m::good(const id::event &event_id) { - return bool(event_id) && index(event_id, std::nothrow) != 0; + return bool(event_id) && index(std::nothrow, event_id) != 0; } bool diff --git a/matrix/event_cached.cc b/matrix/event_cached.cc index 8a2c02a53..5f90c3c74 100644 --- a/matrix/event_cached.cc +++ b/matrix/event_cached.cc @@ -23,7 +23,7 @@ ircd::m::cached(const id::event &event_id, const event::idx event_idx { - index(event_id, std::nothrow) + index(std::nothrow, event_id) }; return event_idx? diff --git a/matrix/event_fetch.cc b/matrix/event_fetch.cc index 92a285792..90601b7f0 100644 --- a/matrix/event_fetch.cc +++ b/matrix/event_fetch.cc @@ -30,7 +30,7 @@ ircd::m::seek(event::fetch &fetch, { const auto &event_idx { - index(event_id, std::nothrow) + index(std::nothrow, event_id) }; return seek(fetch, event_idx, event_id, std::nothrow); @@ -130,7 +130,7 @@ ircd::m::event::fetch::fetch(const event::id &event_id, const opts &opts) :fetch { - index(event_id, std::nothrow), event_id, std::nothrow, opts + index(std::nothrow, event_id), event_id, std::nothrow, opts } { } diff --git a/matrix/event_get.cc b/matrix/event_get.cc index b2cd62330..a8f0d8b92 100644 --- a/matrix/event_get.cc +++ b/matrix/event_get.cc @@ -119,7 +119,7 @@ ircd::m::get(std::nothrow_t, const string_view &key, const mutable_buffer &buf) { - return get(std::nothrow, index(event_id, std::nothrow), key, buf); + return get(std::nothrow, index(std::nothrow, event_id), key, buf); } ircd::const_buffer @@ -172,7 +172,7 @@ ircd::m::get(std::nothrow_t, const string_view &key, const event::fetch::view_closure &closure) { - return get(std::nothrow, index(event_id, std::nothrow), key, closure); + return get(std::nothrow, index(std::nothrow, event_id), key, closure); } bool diff --git a/matrix/event_index.cc b/matrix/event_index.cc index a0fd4ba6c..014191f52 100644 --- a/matrix/event_index.cc +++ b/matrix/event_index.cc @@ -23,10 +23,10 @@ catch(const json::not_found &) } ircd::m::event::idx -ircd::m::index(const event &event, - std::nothrow_t) +ircd::m::index(std::nothrow_t, + const event &event) { - return index(event.event_id, std::nothrow); + return index(std::nothrow, event.event_id); } ircd::m::event::idx @@ -35,7 +35,7 @@ ircd::m::index(const event::id &event_id) assert(event_id); const auto ret { - index(event_id, std::nothrow) + index(std::nothrow, event_id) }; if(!ret) @@ -50,11 +50,11 @@ ircd::m::index(const event::id &event_id) } ircd::m::event::idx -ircd::m::index(const event::id &event_id, - std::nothrow_t) +ircd::m::index(std::nothrow_t, + const event::id &event_id) { event::idx ret{0}; - index(event_id, std::nothrow, [&ret] + index(std::nothrow, event_id, [&ret] (const event::idx &event_idx) { ret = event_idx; @@ -64,8 +64,8 @@ ircd::m::index(const event::id &event_id, } bool -ircd::m::index(const event::id &event_id, - std::nothrow_t, +ircd::m::index(std::nothrow_t, + const event::id &event_id, const event::closure_idx &closure) { auto &column diff --git a/matrix/init_backfill.cc b/matrix/init_backfill.cc index fee5e14ca..193361d98 100644 --- a/matrix/init_backfill.cc +++ b/matrix/init_backfill.cc @@ -595,7 +595,7 @@ ircd::m::init::backfill::gossip(const room::id &room_id, size_t ret{0}; const m::event::refs refs { - m::index(event_id, std::nothrow) + m::index(std::nothrow, event_id) }; static const size_t max{48}; diff --git a/matrix/room_auth.cc b/matrix/room_auth.cc index 38b6a3578..f551dadb5 100644 --- a/matrix/room_auth.cc +++ b/matrix/room_auth.cc @@ -832,7 +832,7 @@ const const auto &auth_event_idx { - m::index(auth_event_id, std::nothrow) + m::index(std::nothrow, auth_event_id) }; if(!auth_event_idx) diff --git a/matrix/room_events.cc b/matrix/room_events.cc index 57e8bc4b1..6026a9310 100644 --- a/matrix/room_events.cc +++ b/matrix/room_events.cc @@ -359,7 +359,7 @@ ircd::m::room::events::seek(const event::id &event_id) { const event::idx &event_idx { - m::index(event_id, std::nothrow) + m::index(std::nothrow, event_id) }; return event_idx? diff --git a/matrix/sync.cc b/matrix/sync.cc index c88539e7d..678512665 100644 --- a/matrix/sync.cc +++ b/matrix/sync.cc @@ -107,14 +107,14 @@ bool ircd::m::sync::apropos(const data &d, const event &event) { - return apropos(d, index(event, std::nothrow)); + return apropos(d, index(std::nothrow, event)); } bool ircd::m::sync::apropos(const data &d, const event::id &event_id) { - return apropos(d, index(event_id, std::nothrow)); + return apropos(d, index(std::nothrow, event_id)); } bool diff --git a/modules/client/notifications.cc b/modules/client/notifications.cc index 83cf8cdf3..e78bcc6e2 100644 --- a/modules/client/notifications.cc +++ b/modules/client/notifications.cc @@ -173,7 +173,7 @@ ircd::m::get_notifications(client &client, { object, "read", json::value { - last_read && index(last_read, std::nothrow) >= event_idx + last_read && index(std::nothrow, last_read) >= event_idx } }; diff --git a/modules/client/rooms/relations.cc b/modules/client/rooms/relations.cc index 303bd83d3..55873ac9d 100644 --- a/modules/client/rooms/relations.cc +++ b/modules/client/rooms/relations.cc @@ -129,7 +129,7 @@ try m::event::idx event_idx { - index(event_id, std::nothrow) + index(std::nothrow, event_id) }; m::event::fetch event diff --git a/modules/m_room_redaction.cc b/modules/m_room_redaction.cc index b12f5b147..209761e86 100644 --- a/modules/m_room_redaction.cc +++ b/modules/m_room_redaction.cc @@ -73,7 +73,7 @@ ircd::m::auth_room_redaction(const m::event &event, // the power levels. const auto redact_target_idx { - m::index(at<"redacts"_>(event), std::nothrow) + m::index(std::nothrow, at<"redacts"_>(event)) }; if(!redact_target_idx)