From 3cac43473784f09bee056ee175066d8cb72c0477 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sat, 7 Mar 2015 19:36:18 +0000 Subject: [PATCH] Minor FindTextDisplayEnd() optimisation --- imgui.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index dad3cd43..8909e84a 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2048,7 +2048,9 @@ void ImGui::Render() static const char* FindTextDisplayEnd(const char* text, const char* text_end = NULL) { const char* text_display_end = text; - while ((!text_end || text_display_end < text_end) && *text_display_end != '\0' && (text_display_end[0] != '#' || text_display_end[1] != '#')) + if (!text_end) + text_end = (const char*)-1; + while (text_display_end < text_end && *text_display_end != '\0' && (text_display_end[0] != '#' || text_display_end[1] != '#')) text_display_end++; return text_display_end; }