diff --git a/src/Processors/Formats/Impl/CSVRowInputFormat.cpp b/src/Processors/Formats/Impl/CSVRowInputFormat.cpp index 9092c7fceba..52f9571f962 100644 --- a/src/Processors/Formats/Impl/CSVRowInputFormat.cpp +++ b/src/Processors/Formats/Impl/CSVRowInputFormat.cpp @@ -417,7 +417,7 @@ std::optional, DataTypes>> CSVSchemaReader::readRo auto fields = reader.readRow(); auto data_types = tryInferDataTypesByEscapingRule(fields, format_settings, FormatSettings::EscapingRule::CSV); - return std::make_pair(fields, data_types); + return std::make_pair(std::move(fields), std::move(data_types)); } std::optional CSVSchemaReader::readRowAndGetDataTypesImpl() diff --git a/src/Processors/Formats/Impl/CustomSeparatedRowInputFormat.cpp b/src/Processors/Formats/Impl/CustomSeparatedRowInputFormat.cpp index ff3d6d49199..17cc88425f5 100644 --- a/src/Processors/Formats/Impl/CustomSeparatedRowInputFormat.cpp +++ b/src/Processors/Formats/Impl/CustomSeparatedRowInputFormat.cpp @@ -388,7 +388,7 @@ std::optional, DataTypes>> CustomSeparatedSchemaRe auto fields = reader.readRow(); auto data_types = tryInferDataTypesByEscapingRule(fields, reader.getFormatSettings(), reader.getEscapingRule(), &json_inference_info); - return std::make_pair(fields, data_types); + return std::make_pair(std::move(fields), std::move(data_types)); } std::optional CustomSeparatedSchemaReader::readRowAndGetDataTypesImpl() diff --git a/src/Processors/Formats/RowInputFormatWithNamesAndTypes.cpp b/src/Processors/Formats/RowInputFormatWithNamesAndTypes.cpp index 4000bd14ddc..fc2b5cd8207 100644 --- a/src/Processors/Formats/RowInputFormatWithNamesAndTypes.cpp +++ b/src/Processors/Formats/RowInputFormatWithNamesAndTypes.cpp @@ -425,7 +425,7 @@ void FormatWithNamesAndTypesSchemaReader::tryDetectHeader(std::vector & if (!first_row) return; - auto [first_row_values, first_row_types] = *first_row; + const auto & [first_row_values, first_row_types] = *first_row; /// The first row contains non String elements, it cannot be a header. if (!checkIfAllTypesAreString(first_row_types)) @@ -443,7 +443,7 @@ void FormatWithNamesAndTypesSchemaReader::tryDetectHeader(std::vector & return; } - auto [second_row_values, second_row_types] = *second_row; + const auto & [second_row_values, second_row_types] = *second_row; DataTypes data_types; bool second_row_can_be_type_names = checkIfAllTypesAreString(second_row_types) && checkIfAllValuesAreTypeNames(readNamesFromFields(second_row_values));