Don't make copies of std::string or fbstring when converting.
authorAndrew Krieger <andrew.krieger@oculus.com>
Tue, 17 Oct 2017 16:17:30 +0000 (09:17 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 17 Oct 2017 16:29:51 +0000 (09:29 -0700)
commitf82f2b0dafc1bff1f36154c513c39f05e10db268
treeb908981b59b5c567e912d44e295e830a605dfe25
parent1d4de585b9bee671244190cf24df528c13b1fb06
Don't make copies of std::string or fbstring when converting.

Summary:
This overload of estimateSpaceNeeded was taking a Src by
value, but Src is constrained by IsSomeString which only returns
true for std::string or fbstring, so this was inducing a copy
in any situation where folly::to<> is used with varargs which
contain fb/string arguments.

Reviewed By: yfeldblum

Differential Revision: D6059517

fbshipit-source-id: adc239f9049e161fc4b750bae0e3de5dbdcd1bfc
folly/Conv.h