mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 07:23:53 +01:00
ircd:Ⓜ️🆔 Deinline ctor; construct string_view tight to valid mxid.
This commit is contained in:
parent
a3a5bfbf30
commit
779fc767d9
2 changed files with 19 additions and 17 deletions
|
@ -81,11 +81,11 @@ struct ircd::m::id
|
|||
|
||||
IRCD_USING_OVERLOAD(generate, m::generate);
|
||||
|
||||
explicit id(const enum sigil &, const id &) noexcept;
|
||||
id(const enum sigil &, const mutable_buffer &, const generate_t &, const string_view &host);
|
||||
id(const enum sigil &, const mutable_buffer &, const string_view &local, const string_view &host);
|
||||
id(const enum sigil &, const mutable_buffer &, const string_view &id);
|
||||
id(const enum sigil &, const string_view &id);
|
||||
explicit id(const enum sigil &, const id &);
|
||||
id(const string_view &id);
|
||||
id() = default;
|
||||
};
|
||||
|
@ -374,26 +374,11 @@ struct ircd::m::id::buf
|
|||
}
|
||||
};
|
||||
|
||||
inline
|
||||
ircd::m::id::id(const string_view &str)
|
||||
:id
|
||||
{
|
||||
m::sigil(str), str
|
||||
}
|
||||
{}
|
||||
|
||||
inline
|
||||
ircd::m::id::id(const id::sigil &sigil,
|
||||
const id &id)
|
||||
noexcept
|
||||
:string_view{id}
|
||||
{
|
||||
assert(this->empty() || this->front() == sigil);
|
||||
}
|
||||
|
||||
inline
|
||||
ircd::m::id::id(const id::sigil &sigil,
|
||||
const string_view &id)
|
||||
:string_view{id}
|
||||
{
|
||||
valid(sigil, id);
|
||||
}
|
||||
|
|
17
matrix/id.cc
17
matrix/id.cc
|
@ -445,6 +445,23 @@ const
|
|||
// id::id
|
||||
//
|
||||
|
||||
ircd::m::id::id(const string_view &str)
|
||||
:id
|
||||
{
|
||||
m::sigil(str), str
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
ircd::m::id::id(const id::sigil &sigil,
|
||||
const string_view &id)
|
||||
:string_view
|
||||
{
|
||||
parser(sigil, id)
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
ircd::m::id::id(const enum sigil &sigil,
|
||||
const mutable_buffer &buf,
|
||||
const string_view &local,
|
||||
|
|
Loading…
Reference in a new issue