summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-21 20:57:32 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-26 11:37:04 +0100
commite661c4acc3805bc0d2b76b83352d43211e59498c (patch)
treed9242b5d02eefd18998bb49442a1e9feb2ee37c7 /src
parent976a33e36a6309133483d851495a5ed6d914628a (diff)
efl_ui_focus_manager_calc: reduce the amount of list operations
it appears that the calculation of the unordered elements can be done a lot easier here, when checking in the initial for loop for the right parent safes us two more list walk later on. Additionally, if all elements in this chain have the right parent, and the amount of elements is the same as the parent has, then this list can be used as a full replacement. Differential Revision: https://phab.enlightenment.org/D7330
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c
index 01cb8673cc..9dd444dde6 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.c
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.c
@@ -683,19 +683,21 @@ _efl_ui_focus_manager_calc_update_order(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data
683 tmp = eina_hash_find(pd->node_hash, &o); 683 tmp = eina_hash_find(pd->node_hash, &o);
684 684
685 if (!tmp) continue; 685 if (!tmp) continue;
686 if (T(tmp).parent != pnode) continue;
686 687
687 node_order = eina_list_append(node_order, tmp); 688 node_order = eina_list_append(node_order, tmp);
688 } 689 }
689 690 if (eina_list_count(node_order) == eina_list_count(T(pnode).children))
690 not_ordered = _set_a_without_b(T(pnode).children, node_order); 691 {
691 trash = _set_a_without_b(node_order, T(pnode).children); 692 eina_list_free(T(pnode).children);
692 node_order_clean = _set_a_without_b(node_order, trash); 693 T(pnode).children = node_order;
693 694 }
694 eina_list_free(node_order); 695 else
695 eina_list_free(trash); 696 {
696 697 not_ordered = _set_a_without_b(T(pnode).children, node_order);
697 eina_list_free(T(pnode).children); 698 eina_list_free(T(pnode).children);
698 T(pnode).children = eina_list_merge(node_order_clean, not_ordered); 699 T(pnode).children = eina_list_merge(node_order, not_ordered);
700 }
699 701
700 return; 702 return;
701} 703}