0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-23 22:13:55 +01:00

ircd:Ⓜ️:fetch: Fix lower_bound() result equality check; comparison operations.

This commit is contained in:
Jason Volk 2019-08-29 23:44:43 -07:00
parent 4b225267fc
commit 284bb7653a

View file

@ -167,7 +167,7 @@ ircd::m::fetch::start(opts opts)
requests.lower_bound(opts)
};
if(it != end(requests) && it->opts.event_id == opts.event_id)
if(it != end(requests) && !(*it < opts) && !(opts < *it))
{
assert(it->opts.room_id == opts.room_id);
return ctx::future<result>{}; //TODO: shared_future.
@ -921,7 +921,7 @@ ircd::m::fetch::operator<(const request &a,
noexcept
{
return uint(a.opts.op) < uint(b.opts.op) &&
a.opts.event_id < b.opts.event_id;
a.opts.event_id < b.opts.event_id &&
a.opts.room_id < b.opts.room_id;
}
@ -931,8 +931,8 @@ ircd::m::fetch::operator<(const request &a,
noexcept
{
return uint(a.opts.op) < uint(b.op) &&
a.opts.event_id < b.event_id;
a.opts.room_id < b.room_id;;
a.opts.event_id < b.event_id &&
a.opts.room_id < b.room_id;
}
bool
@ -942,7 +942,7 @@ noexcept
{
return uint(a.op) < uint(b.opts.op) &&
a.event_id < b.opts.event_id &&
a.room_id < b.opts.room_id;;
a.room_id < b.opts.room_id;
}
//