Minor optimization: reduce redudant label scanning in common widgets.

This commit is contained in:
ocornut
2026-04-09 14:25:34 +02:00
parent c2565fe642
commit 11de9df44c
3 changed files with 45 additions and 30 deletions

View File

@@ -3832,7 +3832,7 @@ void ImGui::RenderText(ImVec2 pos, const char* text, const char* text_end, bool
else
{
if (!text_end)
text_end = text + ImStrlen(text); // FIXME-OPT
text_end = text + ImStrlen(text); // FIXME-OPT (not reached by our internal calls)
text_display_end = text_end;
}
@@ -3850,7 +3850,7 @@ void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end
ImGuiWindow* window = g.CurrentWindow;
if (!text_end)
text_end = text + ImStrlen(text); // FIXME-OPT
text_end = text + ImStrlen(text); // FIXME-OPT (not reached by our internal calls)
if (text != text_end)
{