Skip to content

Commit 4050bd0

Browse files
committed
Improved fix for #680: Not only an OnInitChildren can slow down SelectAll() but other event handlers too. So I removed this condition.
1 parent 2f1bc9a commit 4050bd0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Source/VirtualTrees.pas

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31780,7 +31780,6 @@ procedure TBaseVirtualTree.SelectAll(VisibleOnly: Boolean);
3178031780
var
3178131781
Run: PVirtualNode;
3178231782
NextFunction: TGetNextNodeProc;
31783-
lUseBeginEndUpdate: Boolean;
3178431783
begin
3178531784
if not FSelectionLocked and (toMultiSelect in FOptions.FSelectionOptions) then
3178631785
begin
@@ -31795,9 +31794,7 @@ procedure TBaseVirtualTree.SelectAll(VisibleOnly: Boolean);
3179531794
Run := GetFirst;
3179631795
NextFunction := GetNext;
3179731796
end;
31798-
lUseBeginEndUpdate := Assigned(OnInitChildren); // See issue #680
31799-
if lUseBeginEndUpdate then
31800-
BeginUpdate;
31797+
BeginUpdate(); // Improve performance, see issue #690
3180131798
try
3180231799
while Assigned(Run) do
3180331800
begin
@@ -31809,8 +31806,7 @@ procedure TBaseVirtualTree.SelectAll(VisibleOnly: Boolean);
3180931806
AddToSelection(FTempNodeCache, FTempNodeCount);
3181031807
ClearTempCache;
3181131808
finally
31812-
if lUseBeginEndUpdate then
31813-
EndUpdate();
31809+
EndUpdate();
3181431810
end;//try..finally
3181531811
Invalidate;
3181631812
end;

0 commit comments

Comments
 (0)