0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-28 09:42:37 +01:00

ircd:Ⓜ️:room::aliases: Add has_server() optimized count(server)>0 to interface.

This commit is contained in:
Jason Volk 2023-01-24 20:35:47 -08:00
parent ede3d5a651
commit 4cece76e1c
2 changed files with 12 additions and 0 deletions

View file

@ -30,6 +30,7 @@ struct ircd::m::room::aliases
public:
bool for_each(const string_view &server, const closure_bool &) const;
bool for_each(const closure_bool &) const;
bool has_server(const string_view &) const;
bool has(const alias &) const;
size_t count(const string_view &server) const;
size_t count() const;

View file

@ -66,6 +66,17 @@ const
});
}
bool
ircd::m::room::aliases::has_server(const string_view &server)
const
{
return !for_each(server, []
(const id::room_alias &a) noexcept
{
return false;
});
}
bool
ircd::m::room::aliases::for_each(const closure_bool &closure)
const