Commit c16a3f37 authored by Nick Terrell's avatar Nick Terrell Committed by Facebook Github Bot

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
parent 6fac16c6
......@@ -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<RequestData> 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<RequestData> dflt{nullptr};
return get_ref_default(*data_.rlock(), val, dflt).get();
}
void RequestContext::onSet() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment