0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd::db: Simplify seek() templates.

This commit is contained in:
Jason Volk 2019-09-18 19:14:06 -07:00
parent 35d39a7d70
commit 788542e833
2 changed files with 8 additions and 19 deletions

View file

@ -5245,7 +5245,12 @@ ircd::db::cell::load(const string_view &index,
}
database::column &c(this->c);
if(!seek(c, index, opts, this->it))
const auto _opts
{
make_opts(opts)
};
if(!seek(c, index, _opts, this->it))
return false;
return valid(index);
@ -6610,7 +6615,7 @@ ircd::db::seek(column::const_iterator_base &it,
const pos &p)
{
database::column &c(it);
return seek(c, p, it.opts, it.it);
return seek(c, p, make_opts(it.opts), it.it);
}
template bool ircd::db::seek<ircd::db::pos>(column::const_iterator_base &, const pos &);
template bool ircd::db::seek<ircd::string_view>(column::const_iterator_base &, const string_view &);
@ -7501,25 +7506,10 @@ ircd::db::seek(column &column,
database::column &c(column);
std::unique_ptr<rocksdb::Iterator> ret;
seek(c, key, opts, ret);
seek(c, key, make_opts(opts), ret);
return ret;
}
template<class pos>
bool
ircd::db::seek(database::column &c,
const pos &p,
const gopts &gopts,
std::unique_ptr<rocksdb::Iterator> &it)
{
const rocksdb::ReadOptions opts
{
make_opts(gopts)
};
return seek(c, p, opts, it);
}
template<class pos>
bool
ircd::db::seek(database::column &c,

View file

@ -113,7 +113,6 @@ namespace ircd::db
// [GET] seek suite
template<class pos> bool seek(database::column &, const pos &, const rocksdb::ReadOptions &, std::unique_ptr<rocksdb::Iterator> &it);
template<class pos> bool seek(database::column &, const pos &, const gopts &, std::unique_ptr<rocksdb::Iterator> &it);
std::unique_ptr<rocksdb::Iterator> seek(column &, const gopts &);
std::unique_ptr<rocksdb::Iterator> seek(column &, const string_view &key, const gopts &);
std::vector<row::value_type> seek(database &, const gopts &);