mirror of
https://github.com/matrix-construct/construct
synced 2024-12-01 19:22:53 +01:00
modules/m_init_backfill: Reference a static dummy instance for when_any().
This commit is contained in:
parent
0bc027ebab
commit
b3fc7bdb35
1 changed files with 7 additions and 2 deletions
|
@ -290,9 +290,14 @@ ircd::m::fetch::request_handle()
|
||||||
static const auto dereferencer{[]
|
static const auto dereferencer{[]
|
||||||
(auto &it) -> server::request &
|
(auto &it) -> server::request &
|
||||||
{
|
{
|
||||||
|
// If the request doesn't have a server::request future attached
|
||||||
|
// during this pass we reference this default constructed static
|
||||||
|
// instance which when_any() will treat as a no-op.
|
||||||
|
static server::request request_skip;
|
||||||
auto &request(mutable_cast(*it));
|
auto &request(mutable_cast(*it));
|
||||||
assert(request.future);
|
return request.future?
|
||||||
return *request.future;
|
*request.future:
|
||||||
|
request_skip;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
auto next
|
auto next
|
||||||
|
|
Loading…
Reference in a new issue