提交 0df5b39a 编写于 作者: R Rich Felker

simplify/optimize iconv utf-8 case

the special case where mbrtowc returns 0 but consumed 1 byte of input
does not need to be considered, because the short-circuit for low
bytes already covered that case.
上级 9eb6dd51
......@@ -195,11 +195,10 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
switch (type) {
case UTF_8:
if (c < 128) break; // optimization
if (c < 128) break;
l = mbrtowc_utf8(&wc, *in, *inb, &st);
if (!l) l++;
else if (l == (size_t)-1) goto ilseq;
else if (l == (size_t)-2) goto starved;
if (l == (size_t)-1) goto ilseq;
if (l == (size_t)-2) goto starved;
c = wc;
break;
case US_ASCII:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册