0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd::db: Allow gopts parameter to the cell::seek().

This commit is contained in:
Jason Volk 2018-02-05 15:15:02 -08:00
parent 9c03fcdb95
commit 06816f9e33
2 changed files with 9 additions and 7 deletions

View file

@ -97,7 +97,7 @@ struct ircd::db::cell
friend std::ostream &operator<<(std::ostream &s, const cell &c);
template<class pos> friend bool seek(cell &c, const pos &p);
template<class pos> friend bool seek(cell &c, const pos &p, gopts = {});
};
namespace ircd::db

View file

@ -2930,18 +2930,20 @@ ircd::db::write(const cell::delta *const &begin,
template<class pos>
bool
ircd::db::seek(cell &c,
const pos &p)
const pos &p,
gopts opts)
{
column &cc(c);
database::column &dc(cc);
gopts opts;
if(!opts.snapshot)
opts.snapshot = c.ss;
const auto ropts(make_opts(opts));
return seek(dc, p, ropts, c.it);
}
template bool ircd::db::seek<ircd::db::pos>(cell &, const pos &);
template bool ircd::db::seek<ircd::string_view>(cell &, const string_view &);
template bool ircd::db::seek<ircd::db::pos>(cell &, const pos &, gopts);
template bool ircd::db::seek<ircd::string_view>(cell &, const string_view &, gopts);
// Linkage for incomplete rocksdb::Iterator
ircd::db::cell::cell()
@ -2992,7 +2994,7 @@ ircd::db::cell::cell(column column,
if(index.empty())
return;
seek(*this, index);
seek(*this, index, opts);
if(!valid_eq(*this->it, index))
this->it.reset();
}