From 4da36c24c7635b161ad7143ebe402d08feaff831 Mon Sep 17 00:00:00 2001 From: Amit Dutta Date: Tue, 9 Apr 2024 23:28:49 -0700 Subject: [PATCH] [native] Remove redundant move in PrestoToVeloxConnectorTest With redundant move statement, Meta internal build fails with "moving a temporary object prevents copy elision" error. This compiler error is enabled by following flags: [-Werror,-Wpessimizing-move]. Fixing here by removing the move statements. --- .../tests/PrestoToVeloxConnectorTest.cpp | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/presto-native-execution/presto_cpp/main/types/tests/PrestoToVeloxConnectorTest.cpp b/presto-native-execution/presto_cpp/main/types/tests/PrestoToVeloxConnectorTest.cpp index d4e118b9f4fa7..932f48a611f73 100644 --- a/presto-native-execution/presto_cpp/main/types/tests/PrestoToVeloxConnectorTest.cpp +++ b/presto-native-execution/presto_cpp/main/types/tests/PrestoToVeloxConnectorTest.cpp @@ -23,19 +23,16 @@ class PrestoToVeloxConnectorTest : public ::testing::Test {}; TEST_F(PrestoToVeloxConnectorTest, registerVariousConnectors) { std::vector>> connectorList; - connectorList.emplace_back(std::move(std::pair( - "hive", - std::move(std::make_unique("hive"))))); - connectorList.emplace_back(std::move(std::pair( + connectorList.emplace_back( + std::pair("hive", std::make_unique("hive"))); + connectorList.emplace_back(std::pair( "hive-hadoop2", - std::move( - std::make_unique("hive-hadoop2"))))); - connectorList.emplace_back(std::move(std::pair( - "iceberg", - std::move(std::make_unique("iceberg"))))); - connectorList.emplace_back(std::move(std::pair( - "tpch", - std::move(std::make_unique("tpch"))))); + + std::make_unique("hive-hadoop2"))); + connectorList.emplace_back(std::pair( + "iceberg", std::make_unique("iceberg"))); + connectorList.emplace_back( + std::pair("tpch", std::make_unique("tpch"))); for (auto& [connectorName, connector] : connectorList) { registerPrestoToVeloxConnector(std::move(connector));