0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd::server: Dedup request/tag move semantics.

This commit is contained in:
Jason Volk 2019-04-18 01:10:43 -07:00
parent 91bed23951
commit 2726c67ecc
2 changed files with 8 additions and 19 deletions

View file

@ -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;

View file

@ -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;
}