diff --git a/thrift/lib/cpp2/server/RequestDebugLog.cpp b/thrift/lib/cpp2/server/RequestDebugLog.cpp index 6b3f6f19004..fecb60e021c 100644 --- a/thrift/lib/cpp2/server/RequestDebugLog.cpp +++ b/thrift/lib/cpp2/server/RequestDebugLog.cpp @@ -102,7 +102,7 @@ void appendRequestDebugLog(const std::string& msg) { } std::vector collectRequestDebugLog( - std::shared_ptr rctx) { + const std::shared_ptr& rctx) { DCHECK(rctx.get() != nullptr); auto log = dynamic_cast(rctx->getContextData(getToken())); if (log == nullptr) { @@ -117,7 +117,7 @@ std::vector collectRequestDebugLog( if (rctx == nullptr) { return {}; } - return collectRequestDebugLog(std::move(rctx)); + return collectRequestDebugLog(rctx); } } // namespace thrift diff --git a/thrift/lib/cpp2/server/RequestDebugLog.h b/thrift/lib/cpp2/server/RequestDebugLog.h index da5662e0b21..a818a6a8fba 100644 --- a/thrift/lib/cpp2/server/RequestDebugLog.h +++ b/thrift/lib/cpp2/server/RequestDebugLog.h @@ -30,7 +30,7 @@ namespace thrift { void appendRequestDebugLog(std::string&&); void appendRequestDebugLog(const std::string&); std::vector collectRequestDebugLog( - std::shared_ptr); + const std::shared_ptr&); std::vector collectRequestDebugLog( const RequestsRegistry::DebugStub&);