0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd:Ⓜ️🆔 Deinline ctor; construct string_view tight to valid mxid.

This commit is contained in:
Jason Volk 2020-12-03 01:18:17 -08:00
parent a3a5bfbf30
commit 779fc767d9
2 changed files with 19 additions and 17 deletions

View file

@ -81,11 +81,11 @@ struct ircd::m::id
IRCD_USING_OVERLOAD(generate, m::generate); 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 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 &local, const string_view &host);
id(const enum sigil &, const mutable_buffer &, const string_view &id); id(const enum sigil &, const mutable_buffer &, const string_view &id);
id(const enum sigil &, 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(const string_view &id);
id() = default; 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 inline
ircd::m::id::id(const id::sigil &sigil, ircd::m::id::id(const id::sigil &sigil,
const id &id) const id &id)
noexcept
:string_view{id} :string_view{id}
{ {
assert(this->empty() || this->front() == sigil); 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);
}

View file

@ -445,6 +445,23 @@ const
// id::id // 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, ircd::m::id::id(const enum sigil &sigil,
const mutable_buffer &buf, const mutable_buffer &buf,
const string_view &local, const string_view &local,