mirror of
https://github.com/matrix-construct/construct
synced 2024-11-12 04:51:08 +01:00
ircd::db: Simplify seek() templates.
This commit is contained in:
parent
35d39a7d70
commit
788542e833
2 changed files with 8 additions and 19 deletions
26
ircd/db.cc
26
ircd/db.cc
|
@ -5245,7 +5245,12 @@ ircd::db::cell::load(const string_view &index,
|
||||||
}
|
}
|
||||||
|
|
||||||
database::column &c(this->c);
|
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 false;
|
||||||
|
|
||||||
return valid(index);
|
return valid(index);
|
||||||
|
@ -6610,7 +6615,7 @@ ircd::db::seek(column::const_iterator_base &it,
|
||||||
const pos &p)
|
const pos &p)
|
||||||
{
|
{
|
||||||
database::column &c(it);
|
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::db::pos>(column::const_iterator_base &, const pos &);
|
||||||
template bool ircd::db::seek<ircd::string_view>(column::const_iterator_base &, const string_view &);
|
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);
|
database::column &c(column);
|
||||||
|
|
||||||
std::unique_ptr<rocksdb::Iterator> ret;
|
std::unique_ptr<rocksdb::Iterator> ret;
|
||||||
seek(c, key, opts, ret);
|
seek(c, key, make_opts(opts), ret);
|
||||||
return 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>
|
template<class pos>
|
||||||
bool
|
bool
|
||||||
ircd::db::seek(database::column &c,
|
ircd::db::seek(database::column &c,
|
||||||
|
|
|
@ -113,7 +113,6 @@ namespace ircd::db
|
||||||
|
|
||||||
// [GET] seek suite
|
// [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 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 gopts &);
|
||||||
std::unique_ptr<rocksdb::Iterator> seek(column &, const string_view &key, const gopts &);
|
std::unique_ptr<rocksdb::Iterator> seek(column &, const string_view &key, const gopts &);
|
||||||
std::vector<row::value_type> seek(database &, const gopts &);
|
std::vector<row::value_type> seek(database &, const gopts &);
|
||||||
|
|
Loading…
Reference in a new issue