File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -428,33 +428,13 @@ static string intToString(const Cli::Convert & cvt, int val) {
428428 return out;
429429}
430430
431- // ===========================================================================
432- inline static bool parseStr (string * out, const char16_t * src, size_t len) {
433- out->resize (4 * len + 1 );
434- auto dst = out->data ();
435- mbstate_t state = {};
436- size_t mblen = 0 ;
437- for (auto i = 0 ; i < len; ++i) {
438- assert (out->data () + out->size () - dst > MB_CUR_MAX );
439- mblen = c16rtomb (dst, src[i], &state);
440- if (mblen == -1 ) {
441- out->resize (dst - out->data ());
442- return false ;
443- }
444- dst += mblen;
445- }
446- dst += c16rtomb (dst, 0 , &state);
447- out->resize (dst - out->data () - 1 );
448- return mblen != -1 ;
449- }
450-
451431// ===========================================================================
452432static bool parseStr (string * out, const wchar_t * src, size_t len) {
453433 out->resize (4 * len + 1 );
454434 auto dst = out->data ();
455435 mbstate_t state = {};
456436 size_t mblen = 0 ;
457- for (auto i = 0 ; i < len; ++i) {
437+ for (auto i = 0u ; i < len; ++i) {
458438 assert (out->data () + out->size () - dst > MB_CUR_MAX );
459439 mblen = wcrtomb (dst, src[i], &state);
460440 if (mblen == -1 ) {
You can’t perform that action at this time.
0 commit comments