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

ircd:Ⓜ️:event::refs: Branch on the event_idx sentinel here.

This commit is contained in:
Jason Volk 2019-09-15 20:19:07 -07:00
parent 3f65055892
commit 568a2881df
2 changed files with 4 additions and 5 deletions

View file

@ -47,6 +47,4 @@ inline
ircd::m::event::refs::refs(const event::idx &idx)
noexcept
:idx{idx}
{
assert(idx);
}
{}

View file

@ -1895,7 +1895,6 @@ size_t
ircd::m::event::refs::count(const dbs::ref &type)
const
{
assert(idx);
size_t ret(0);
for_each(type, [&ret]
(const event::idx &, const dbs::ref &)
@ -1950,9 +1949,11 @@ ircd::m::event::refs::for_each(const dbs::ref &type,
const closure_bool &closure)
const
{
assert(idx);
thread_local char buf[dbs::EVENT_REFS_KEY_MAX_SIZE];
if(!idx)
return true;
// Allow -1 to iterate through all types by starting
// the iteration at type value 0 and then ignoring the
// type as a loop continue condition.