66
66
#include <cstdarg>
67
67
#include <cstdio>
68
68
#include <cstdlib>
69
+ #include <utility>
69
70
#ifndef _WIN32
70
71
#include <poll.h>
71
72
#include <sys/time.h>
@@ -678,7 +679,9 @@ static void free_all_replace() {
678
679
class AsyncTimer {
679
680
public:
680
681
explicit AsyncTimer(std::string label)
681
- : label_(label), time_(std::chrono::system_clock::now()), start_(time_) {}
682
+ : label_(std::move(label)),
683
+ time_(std::chrono::system_clock::now()),
684
+ start_(time_) {}
682
685
683
686
~AsyncTimer() {
684
687
auto now = std::chrono::system_clock::now();
@@ -5948,7 +5951,8 @@ static bool check_and_filter_once_property(DYNAMIC_STRING ds_property,
5948
5951
/// @param once_prop Flag specifying whether a property should be set
5949
5952
/// for next statement only.
5950
5953
static void handle_disable_warnings(std::uint32_t warning_code,
5951
- std::string warning, bool once_prop) {
5954
+ const std::string &warning,
5955
+ bool once_prop) {
5952
5956
if (enabled_warnings->count()) {
5953
5957
// Remove the warning from list of enabled warnings.
5954
5958
enabled_warnings->remove_warning(warning_code, once_prop);
@@ -5973,7 +5977,7 @@ static void handle_disable_warnings(std::uint32_t warning_code,
5973
5977
/// @param once_prop Flag specifying whether a property should be set
5974
5978
/// for next statement only.
5975
5979
static void handle_enable_warnings(std::uint32_t warning_code,
5976
- std::string warning, bool once_prop) {
5980
+ const std::string & warning, bool once_prop) {
5977
5981
if (disabled_warnings->count()) {
5978
5982
// Remove the warning from list of disabled warnings.
5979
5983
disabled_warnings->remove_warning(warning_code, once_prop);
@@ -8641,7 +8645,7 @@ static bool match_warnings(Expected_warnings *warnings, std::uint32_t error,
8641
8645
///
8642
8646
/// @retval True if a warning is found in the list of disabled or enabled
8643
8647
/// warnings, false otherwise.
8644
- static bool handle_one_warning(DYNAMIC_STRING *ds, std::string warning) {
8648
+ static bool handle_one_warning(DYNAMIC_STRING *ds, const std::string & warning) {
8645
8649
// Each line of show warnings output contains information about
8646
8650
// error level, error code and the error/warning message separated
8647
8651
// by '\t'. Parse each line from the show warnings output to
@@ -11584,7 +11588,7 @@ class Comp_lines {
11584
11588
}
11585
11589
};
11586
11590
11587
- static size_t length_of_n_first_columns(std::string str,
11591
+ static size_t length_of_n_first_columns(const std::string & str,
11588
11592
int start_sort_column) {
11589
11593
std::stringstream columns(str);
11590
11594
std::string temp;
0 commit comments