From 66199125fd59b24277a8c40a2b55af71306a7d77 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Mon, 29 Aug 2011 22:07:24 +0200 Subject: textedit: minor optimization in FormatLine(). If there is no text in the line, no need to process it further. --- examples/apps/ide/src/fpg_textedit.pas | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/apps/ide/src/fpg_textedit.pas b/examples/apps/ide/src/fpg_textedit.pas index e63eb09b..58789664 100644 --- a/examples/apps/ide/src/fpg_textedit.pas +++ b/examples/apps/ide/src/fpg_textedit.pas @@ -1587,7 +1587,11 @@ begin Exit; //==> if (ALineIndex < 0) or (ALineIndex > FLines.Count-1) then Exit; //==> + S := FLines[ALineIndex]; + if Length(s) = 0 then + Exit; // no text to draw, so we are done + if Pos(#9, S) > 0 then begin CorrectS := ''; -- cgit v1.2.3-70-g09d2