string_util: Get rid of separate resize() in CPToUTF16(), UTF16ToUTF8(), CodeToUTF8() and UTF8ToUTF16()

There's no need to perform the resize separately here, since the
constructor allows presizing the buffer.

Also move the empty string check before the construction of the string
to make the early out more straightforward.
This commit is contained in:
Lioncash 2018-07-22 15:47:37 -04:00
parent 26a157cd31
commit 9d33122197
1 changed files with 22 additions and 20 deletions