diff --git a/presto-native-execution/presto_cpp/main/http/HttpClient.cpp b/presto-native-execution/presto_cpp/main/http/HttpClient.cpp index 0b5c559803a8f..3c951d2217dc1 100644 --- a/presto-native-execution/presto_cpp/main/http/HttpClient.cpp +++ b/presto-native-execution/presto_cpp/main/http/HttpClient.cpp @@ -54,7 +54,7 @@ HttpClient::HttpClient( http2SessionWindow_( SystemConfig::instance()->httpClientHttp2SessionWindow()), pool_(std::move(pool)), - sslContext_(sslContext), + sslContext_(std::move(sslContext)), reportOnBodyStatsFunc_(std::move(reportOnBodyStatsFunc)), maxResponseAllocBytes_(SystemConfig::instance()->httpMaxAllocateBytes()) { } @@ -207,7 +207,7 @@ class ResponseHandler : public proxygen::HTTPTransactionHandler { folly::SemiFuture> initialize( std::shared_ptr self) { - self_ = self; + self_ = std::move(self); return promise_.getSemiFuture(); } @@ -342,7 +342,7 @@ class ConnectionHandler : public proxygen::HTTPConnector::Callback { folly::SSLContextPtr sslContext) : responseHandler_(responseHandler), sessionPool_(sessionPool), - transactionTimer_(transactionTimeout), + transactionTimer_(std::move(transactionTimeout)), connectTimeout_(connectTimeout), http2Enabled_(http2Enabled), maxConcurrentStreams_(maxConcurrentStreams), diff --git a/presto-native-execution/presto_cpp/main/http/HttpServer.cpp b/presto-native-execution/presto_cpp/main/http/HttpServer.cpp index df11c0bdafe8c..ebeb1e7f69c9b 100644 --- a/presto-native-execution/presto_cpp/main/http/HttpServer.cpp +++ b/presto-native-execution/presto_cpp/main/http/HttpServer.cpp @@ -218,7 +218,7 @@ proxygen::RequestHandler* DispatchingRequestHandlerFactory::onRequest( message->getURL())); } - auto path = message->getPath(); + const auto& path = message->getPath(); // Allocate vector outside of loop to avoid repeated alloc/free. std::vector matches(4); diff --git a/presto-native-execution/presto_cpp/main/http/HttpServer.h b/presto-native-execution/presto_cpp/main/http/HttpServer.h index b5c89129cf6b5..32e13029bb5a4 100644 --- a/presto-native-execution/presto_cpp/main/http/HttpServer.h +++ b/presto-native-execution/presto_cpp/main/http/HttpServer.h @@ -106,7 +106,7 @@ class CallbackRequestHandlerState { // The function 'fn' will run on the thread that invoked onEOM() void runOnFinalization(std::function callback) { - onFinalizationCallback_ = callback; + onFinalizationCallback_ = std::move(callback); } bool requestExpired() const { @@ -136,10 +136,11 @@ using AsyncRequestHandlerCallback = std::function