Strip seemingly unecessary tests, as UTF-8 decoder can not return null since 9cca1b2e9

This commit is contained in:
ocornut
2023-01-12 12:46:06 +01:00
parent 55b8ce9b23
commit ccf94e2e6e
3 changed files with 3 additions and 23 deletions

View File

@ -1288,8 +1288,7 @@ void ImGuiIO::AddInputCharactersUTF8(const char* utf8_chars)
{
unsigned int c = 0;
utf8_chars += ImTextCharFromUtf8(&c, utf8_chars, NULL);
if (c != 0)
AddInputCharacter(c);
AddInputCharacter(c);
}
}
@ -2032,8 +2031,6 @@ int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const cha
{
unsigned int c;
in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
if (c == 0)
break;
*buf_out++ = (ImWchar)c;
}
*buf_out = 0;
@ -2049,8 +2046,6 @@ int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
{
unsigned int c;
in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
if (c == 0)
break;
char_count++;
}
return char_count;