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:
parent
ede3d5a651
commit
4cece76e1c
2 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue