warnings vector is copied 2 times unnecessarily in query_processor::execute_direct_without_checking_exception_message() and query_processor::do_execute_direct() #20361
but, again as the variable is const, it results another copying of the vector.
looking at the function do_execute_direct , moving the object is completely redundant as the variable is not moved to a co-routine, but is copied from, thus making warnings and the function parameter a const reference would work better in this case.
Below code at query_processor.cc:571
Makes a copy of a std::vector as
p->statement
is declaredconst
inprepared_statement
:Later, at line query_processor.cc:589 the same
const warnings
variable attempted to be moved again:but, again as the variable is const, it results another copying of the vector. looking at the function
do_execute_direct
, moving the object is completely redundant as the variable is not moved to a co-routine, but is copied from, thus makingwarnings
and the function parameter a const reference would work better in this case.