From d034ac7a7bd54c7f484310f4818c9e8449b62ad7 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 18 Dec 2020 23:06:14 -0800 Subject: [PATCH] ircd::m::dbs: Remove requirement for opts.event_idx in prefetch(). --- matrix/dbs.cc | 3 --- matrix/dbs_event_horizon.cc | 8 +++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/matrix/dbs.cc b/matrix/dbs.cc index 5dfb25119..244daf8a4 100644 --- a/matrix/dbs.cc +++ b/matrix/dbs.cc @@ -236,9 +236,6 @@ ircd::m::dbs::prefetch(const event &event, const write_opts &opts) try { - if(unlikely(opts.event_idx == 0)) - return false; - if(!prefetch_enable) return false; diff --git a/matrix/dbs_event_horizon.cc b/matrix/dbs_event_horizon.cc index b885efa21..8dcc443ee 100644 --- a/matrix/dbs_event_horizon.cc +++ b/matrix/dbs_event_horizon.cc @@ -194,16 +194,18 @@ ircd::m::dbs::_prefetch_event_horizon_resolve(const event &event, const write_opts &opts) { assert(opts.appendix.test(appendix::EVENT_HORIZON_RESOLVE)); - assert(opts.event_idx != 0); - assert(event.event_id); + + size_t ret(0); + if(!event.event_id) + return ret; char buf[EVENT_HORIZON_KEY_MAX_SIZE]; + assert(event.event_id); const string_view &key { event_horizon_key(buf, event.event_id) }; - size_t ret(0); for(auto it(dbs::event_horizon.begin(key)); it; ++it) { const auto event_idx