mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
RenderText(), InputTextMultiline(): Optimization for large text by using memchr, wmemchr, wcschr when appropriate.
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user