0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd:Ⓜ️:dbs: Replace pairs with tuples for reference lifetime issue w/ clang.

This commit is contained in:
Jason Volk 2020-02-20 13:49:39 -08:00
parent a13d9282ac
commit 20bc23abde
4 changed files with 7 additions and 7 deletions

View file

@ -20,7 +20,7 @@ namespace ircd::m::dbs
string_view room_events_key(const mutable_buffer &out, const id::room &, const uint64_t &depth, const event::idx &); string_view room_events_key(const mutable_buffer &out, const id::room &, const uint64_t &depth, const event::idx &);
string_view room_events_key(const mutable_buffer &out, const id::room &, const uint64_t &depth); string_view room_events_key(const mutable_buffer &out, const id::room &, const uint64_t &depth);
std::pair<uint64_t, event::idx> room_events_key(const string_view &amalgam); std::tuple<uint64_t, event::idx> room_events_key(const string_view &amalgam);
// room_id | depth, event_idx => node_id // room_id | depth, event_idx => node_id
extern db::domain room_events; extern db::domain room_events;

View file

@ -20,7 +20,7 @@ namespace ircd::m::dbs
string_view room_joined_key(const mutable_buffer &out, const id::room &, const string_view &origin, const id::user &member); string_view room_joined_key(const mutable_buffer &out, const id::room &, const string_view &origin, const id::user &member);
string_view room_joined_key(const mutable_buffer &out, const id::room &, const string_view &origin); string_view room_joined_key(const mutable_buffer &out, const id::room &, const string_view &origin);
std::pair<string_view, string_view> room_joined_key(const string_view &amalgam); std::tuple<string_view, string_view> room_joined_key(const string_view &amalgam);
// room_id | origin, member => event_idx // room_id | origin, member => event_idx
extern db::domain room_joined; extern db::domain room_joined;

View file

@ -20,7 +20,7 @@ namespace ircd::m::dbs
string_view room_state_key(const mutable_buffer &out, const id::room &, const string_view &type, const string_view &state_key); string_view room_state_key(const mutable_buffer &out, const id::room &, const string_view &type, const string_view &state_key);
string_view room_state_key(const mutable_buffer &out, const id::room &, const string_view &type); string_view room_state_key(const mutable_buffer &out, const id::room &, const string_view &type);
std::pair<string_view, string_view> room_state_key(const string_view &amalgam); std::tuple<string_view, string_view> room_state_key(const string_view &amalgam);
// room_id | type, state_key => event_idx // room_id | type, state_key => event_idx
extern db::domain room_state; extern db::domain room_state;

View file

@ -2994,7 +2994,7 @@ ircd::m::dbs::desc::events__room_events__cmp
return false; return false;
// Distill out the depth and event_idx integers // Distill out the depth and event_idx integers
const std::pair<uint64_t, event::idx> pair[2] const std::tuple<uint64_t, event::idx> pair[2]
{ {
room_events_key(post[0]), room_events_key(post[0]),
room_events_key(post[1]) room_events_key(post[1])
@ -3056,7 +3056,7 @@ ircd::m::dbs::room_events_key(const mutable_buffer &out_,
return { data(out_), data(out) }; return { data(out_), data(out) };
} }
std::pair<uint64_t, ircd::m::event::idx> std::tuple<uint64_t, ircd::m::event::idx>
ircd::m::dbs::room_events_key(const string_view &amalgam) ircd::m::dbs::room_events_key(const string_view &amalgam)
{ {
assert(size(amalgam) >= 1 + 8 + 8 || size(amalgam) == 1 + 8); assert(size(amalgam) >= 1 + 8 + 8 || size(amalgam) == 1 + 8);
@ -3242,7 +3242,7 @@ ircd::m::dbs::room_joined_key(const mutable_buffer &out_,
return { data(out_), data(out) }; return { data(out_), data(out) };
} }
std::pair<ircd::string_view, ircd::string_view> std::tuple<ircd::string_view, ircd::string_view>
ircd::m::dbs::room_joined_key(const string_view &amalgam) ircd::m::dbs::room_joined_key(const string_view &amalgam)
{ {
const auto &key const auto &key
@ -3418,7 +3418,7 @@ ircd::m::dbs::room_state_key(const mutable_buffer &out_,
return { data(out_), data(out) }; return { data(out_), data(out) };
} }
std::pair<ircd::string_view, ircd::string_view> std::tuple<ircd::string_view, ircd::string_view>
ircd::m::dbs::room_state_key(const string_view &amalgam) ircd::m::dbs::room_state_key(const string_view &amalgam)
{ {
const auto &key const auto &key