Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions presto-native-execution/presto_cpp/main/http/HttpClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
}
Expand Down Expand Up @@ -207,7 +207,7 @@ class ResponseHandler : public proxygen::HTTPTransactionHandler {

folly::SemiFuture<std::unique_ptr<HttpResponse>> initialize(
std::shared_ptr<ResponseHandler> self) {
self_ = self;
self_ = std::move(self);
return promise_.getSemiFuture();
}

Expand Down Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> matches(4);
Expand Down
7 changes: 4 additions & 3 deletions presto-native-execution/presto_cpp/main/http/HttpServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class CallbackRequestHandlerState {

// The function 'fn' will run on the thread that invoked onEOM()
void runOnFinalization(std::function<void(void)> callback) {
onFinalizationCallback_ = callback;
onFinalizationCallback_ = std::move(callback);
}

bool requestExpired() const {
Expand Down Expand Up @@ -136,10 +136,11 @@ using AsyncRequestHandlerCallback = std::function<void(
class CallbackRequestHandler : public AbstractRequestHandler {
public:
explicit CallbackRequestHandler(RequestHandlerCallback callback)
: callback_(wrap(callback)) {}
: callback_(wrap(std::move(callback))) {}

explicit CallbackRequestHandler(AsyncRequestHandlerCallback callback)
: callback_(callback), state_{CallbackRequestHandlerState::create()} {}
: callback_(std::move(callback)),
state_{CallbackRequestHandlerState::create()} {}

~CallbackRequestHandler() override {
if (state_) {
Expand Down
Loading