From a51eab990751d6673e99d6c85968cdaa0e0217e4 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Fri, 6 Jun 2014 17:29:04 +0000 Subject: [PATCH] Optimize previous commit. Filtering the grid causes quite a bit CPU load, so we're now only doing the second search pass for unformatted numbers if the text to find is detected as an unformatted number. --- source/main.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/main.pas b/source/main.pas index b017a114..33a79e38 100644 --- a/source/main.pas +++ b/source/main.pas @@ -7142,7 +7142,12 @@ begin // Search for given text in node's captions if not match then for i := 0 to VT.Header.Columns.Count - 1 do begin CellText := VT.Text[Node, i]; - if (Pos( search, LowerCase(CellText)) > 0) or (Pos(search, UnformatNumber(CellText)) > 0) then begin + if Pos( search, LowerCase(CellText)) > 0 then begin + match := True; + break; + end; + // Search for unformatted numbers. Only if text to find is a number, to reduce CPU load for other cases. + if IsNumeric(search) then if Pos(search, UnformatNumber(CellText)) > 0 then begin match := True; break; end;