Simplify fbstring::insertImpl
Summary:The current implementation of `insertImpl` assumes that
`expand_noinit` does not reallocate if the `size() + delta <=
capacity()`, but
D3114022 makes this assumption invalid when compiling
with ASan. It also doesn't guarantee exponential growth, so repeated
inserting at the end could trigger quadratic behavior.
The new implementation fixes the problems above, and it's much
simpler.
Reviewed By: yfeldblum, Orvid
Differential Revision:
D3119813
fb-gh-sync-id:
946ebeeaf924a531f7f03fb7e79c75e352a50c58
fbshipit-source-id:
946ebeeaf924a531f7f03fb7e79c75e352a50c58