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.

This commit is contained in:
Ansgar Becker
2014-06-06 17:29:04 +00:00
parent 0bd5bdba09
commit a51eab9907

View File

@ -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;