From 5503240c6924edaa31ac3fe962696e9da0351234 Mon Sep 17 00:00:00 2001 From: gmpassos Date: Mon, 16 Sep 2024 02:54:43 -0300 Subject: [PATCH] bones_ui_component: optimize `_getUIComponent`. --- lib/src/bones_ui_component.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/bones_ui_component.dart b/lib/src/bones_ui_component.dart index 9ac0e23..3fe3cbc 100644 --- a/lib/src/bones_ui_component.dart +++ b/lib/src/bones_ui_component.dart @@ -1022,7 +1022,8 @@ abstract class UIComponent extends UIEventHandler { } if (uiComponent == null) { - for (var uiRootComponent in UIRootComponent.getInstances()) { + var uiRootComponents = UIRootComponent.getInstances(); + for (var uiRootComponent in uiRootComponents.reversed) { if (uiRootComponent == uiRoot) continue; uiComponent = caller(uiRootComponent);