From c16a3f3775fa166503b4a07150a709c6787c1471 Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Fri, 24 Mar 2017 15:00:07 -0700 Subject: [PATCH] Avoid passing temporary to get_ref_default() Summary: `get_ref_default()` won't accept temporary default values after D4768769. Reviewed By: yfeldblum Differential Revision: D4769043 fbshipit-source-id: 46b039e13b80721922f69036c6cc02f5642a26f9 --- folly/io/async/Request.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/folly/io/async/Request.cpp b/folly/io/async/Request.cpp index 0c56d200..e82b16fd 100644 --- a/folly/io/async/Request.cpp +++ b/folly/io/async/Request.cpp @@ -61,12 +61,14 @@ bool RequestContext::hasContextData(const std::string& val) const { } RequestData* RequestContext::getContextData(const std::string& val) { - return get_ref_default(*data_.rlock(), val, nullptr).get(); + const std::unique_ptr dflt{nullptr}; + return get_ref_default(*data_.rlock(), val, dflt).get(); } const RequestData* RequestContext::getContextData( const std::string& val) const { - return get_ref_default(*data_.rlock(), val, nullptr).get(); + const std::unique_ptr dflt{nullptr}; + return get_ref_default(*data_.rlock(), val, dflt).get(); } void RequestContext::onSet() { -- 2.34.1