Simplify doSetContextData
Summary: The main change is to grab a wlock in doSetContextData, which enables to make the code more readable, and (insignificantly) more efficient. Grabbing the wlock directly is also strictly better for both `set` and `override`. `setIfAbsent` is the only one to potentially suffers from the lock change, in the case where it already exists. But `setIfAbsent` isn't used by either of the guards, which are the recommended way of changing values in RequestContext. So it seems incorrect to optimize for it, and overkill to fork the code. Reviewed By: yfeldblum Differential Revision: D15604768 fbshipit-source-id: 44f564b09ff50e8bfe0e1c4cf5ee2d77b654e929
Showing
Please register or sign in to comment