mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 02:02:38 +01:00
ircd::server: Dedup request/tag move semantics.
This commit is contained in:
parent
91bed23951
commit
2726c67ecc
2 changed files with 8 additions and 19 deletions
|
@ -215,15 +215,10 @@ ircd::server::request::operator=(request &&o)
|
|||
noexcept
|
||||
{
|
||||
this->~request();
|
||||
|
||||
ctx::future<http::code>::operator=(std::move(o));
|
||||
out = std::move(o.out);
|
||||
in = std::move(o.in);
|
||||
tag = std::move(o.tag);
|
||||
opt = std::move(o.opt);
|
||||
|
||||
if(tag)
|
||||
associate(*this, *tag, std::move(o));
|
||||
new (this) request
|
||||
{
|
||||
std::move(o)
|
||||
};
|
||||
|
||||
assert(!o.tag);
|
||||
return *this;
|
||||
|
|
|
@ -124,17 +124,11 @@ ircd::server::tag::operator=(tag &&o)
|
|||
noexcept
|
||||
{
|
||||
this->~tag();
|
||||
new (this) tag
|
||||
{
|
||||
std::move(o)
|
||||
};
|
||||
|
||||
state = std::move(o.state);
|
||||
p = std::move(o.p);
|
||||
request = std::move(o.request);
|
||||
cancellation = std::move(o.cancellation);
|
||||
|
||||
if(request)
|
||||
associate(*request, *this, std::move(o));
|
||||
|
||||
assert(!o.request);
|
||||
assert(!o.cancellation);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue