optimize optional_field_ref::ensure()
optimize optional_field_ref::ensure()

Summary:
Currently `optional_field_ref::ensure()` calls `emplace()` to construct the data if field is empty.

The problem is that `emplace()` will construct the value twice (clear the value first, then construct it).

Normally this won't be a problem, since compiler can optimize out one construction (especially for trivial default constructible types). However, there are cases that compiler couldn't optimize it out.

BTW the best way is destroying the data in `reset()` without reconstructing it (so that data will only be constructed once). Though this is not doable until we get rid of `value_unchecked`.

Reviewed By: yfeldblum

Differential Revision: D34149269

fbshipit-source-id: 65e0ded75f331dd22a6809496cf7f3981e5ee972

facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift