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:
parent
9c03fcdb95
commit
06816f9e33
2 changed files with 9 additions and 7 deletions
|
@ -97,7 +97,7 @@ struct ircd::db::cell
|
||||||
|
|
||||||
friend std::ostream &operator<<(std::ostream &s, const cell &c);
|
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
|
namespace ircd::db
|
||||||
|
|
14
ircd/db.cc
14
ircd/db.cc
|
@ -2930,18 +2930,20 @@ ircd::db::write(const cell::delta *const &begin,
|
||||||
template<class pos>
|
template<class pos>
|
||||||
bool
|
bool
|
||||||
ircd::db::seek(cell &c,
|
ircd::db::seek(cell &c,
|
||||||
const pos &p)
|
const pos &p,
|
||||||
|
gopts opts)
|
||||||
{
|
{
|
||||||
column &cc(c);
|
column &cc(c);
|
||||||
database::column &dc(cc);
|
database::column &dc(cc);
|
||||||
|
|
||||||
gopts opts;
|
if(!opts.snapshot)
|
||||||
opts.snapshot = c.ss;
|
opts.snapshot = c.ss;
|
||||||
|
|
||||||
const auto ropts(make_opts(opts));
|
const auto ropts(make_opts(opts));
|
||||||
return seek(dc, p, ropts, c.it);
|
return seek(dc, p, ropts, c.it);
|
||||||
}
|
}
|
||||||
template bool ircd::db::seek<ircd::db::pos>(cell &, const pos &);
|
template bool ircd::db::seek<ircd::db::pos>(cell &, const pos &, gopts);
|
||||||
template bool ircd::db::seek<ircd::string_view>(cell &, const string_view &);
|
template bool ircd::db::seek<ircd::string_view>(cell &, const string_view &, gopts);
|
||||||
|
|
||||||
// Linkage for incomplete rocksdb::Iterator
|
// Linkage for incomplete rocksdb::Iterator
|
||||||
ircd::db::cell::cell()
|
ircd::db::cell::cell()
|
||||||
|
@ -2992,7 +2994,7 @@ ircd::db::cell::cell(column column,
|
||||||
if(index.empty())
|
if(index.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
seek(*this, index);
|
seek(*this, index, opts);
|
||||||
if(!valid_eq(*this->it, index))
|
if(!valid_eq(*this->it, index))
|
||||||
this->it.reset();
|
this->it.reset();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue