mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 11:10:40 +00:00
cql3: make prepare_context::get_variable_specifications() return const-ref for lvalue overload
There's no point in copying the `_specs` vector by value in such case, just return a const reference. All existing uses create a copy either way. Tests: unit(dev) Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
This commit is contained in:
@@ -58,8 +58,8 @@ size_t prepare_context::bound_variables_size() const {
|
||||
return _variable_names.size();
|
||||
}
|
||||
|
||||
std::vector<lw_shared_ptr<column_specification>> prepare_context::get_variable_specifications() const & {
|
||||
return std::vector<lw_shared_ptr<column_specification>>(_specs.begin(), _specs.end());
|
||||
const std::vector<lw_shared_ptr<column_specification>>& prepare_context::get_variable_specifications() const & {
|
||||
return _specs;
|
||||
}
|
||||
|
||||
std::vector<lw_shared_ptr<column_specification>> prepare_context::get_variable_specifications() && {
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
|
||||
size_t bound_variables_size() const;
|
||||
|
||||
std::vector<lw_shared_ptr<column_specification>> get_variable_specifications() const &;
|
||||
const std::vector<lw_shared_ptr<column_specification>>& get_variable_specifications() const &;
|
||||
|
||||
std::vector<lw_shared_ptr<column_specification>> get_variable_specifications() &&;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user