mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
index: make non-pointer overload of is_index function
Previous interface enforced passing a shared pointer, which might result in calling unneeded shared_from_this().
This commit is contained in:
@@ -157,8 +157,12 @@ std::vector<index> secondary_index_manager::list_indexes() const {
|
||||
}
|
||||
|
||||
bool secondary_index_manager::is_index(view_ptr view) const {
|
||||
return boost::algorithm::any_of(_indices | boost::adaptors::map_values, [&view] (const index& i) {
|
||||
return view->cf_name() == index_table_name(i.metadata().name());
|
||||
return is_index(*view);
|
||||
}
|
||||
|
||||
bool secondary_index_manager::is_index(const schema& s) const {
|
||||
return boost::algorithm::any_of(_indices | boost::adaptors::map_values, [&s] (const index& i) {
|
||||
return s.cf_name() == index_table_name(i.metadata().name());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ public:
|
||||
std::vector<index_metadata> get_dependent_indices(const column_definition& cdef) const;
|
||||
std::vector<index> list_indexes() const;
|
||||
bool is_index(view_ptr) const;
|
||||
bool is_index(const schema& s) const;
|
||||
private:
|
||||
void add_index(const index_metadata& im);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user