RenderText(), InputTextMultiline(): Optimization for large text by using memchr, wmemchr, wcschr when appropriate.

This commit is contained in:
omar
2018-10-12 12:34:47 +02:00
parent 0fe48cbb61
commit 9cf94d5dd6
4 changed files with 20 additions and 22 deletions

View File

@ -850,6 +850,7 @@ CODE
#include <ctype.h> // toupper, isprint
#include <stdio.h> // vsnprintf, sscanf, printf
#include <wchar.h> // wcslen
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
#include <stddef.h> // intptr_t
#else
@ -1210,9 +1211,7 @@ const char* ImStrchrRange(const char* str, const char* str_end, char c)
int ImStrlenW(const ImWchar* str)
{
int n = 0;
while (*str++) n++;
return n;
return (int)wcslen((const wchar_t*)str);
}
// Find end-of-line. Return pointer will point to either first \n, either str_end.