summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-11-09 15:03:03 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-11-09 15:03:03 +0100
commit4b116627c24a43248abf5a34a391241b1c0cf983 (patch)
treebdbc62ed4627232855f05e89c1487ab743bb7f8c
parent0bebaed0acd3b07d2d85e0269344f628a5d9e575 (diff)
Eo: Optimise event callback call
check if the event is frozen before walking the event list
-rw-r--r--src/lib/eo/eo_base_class.c53
1 files changed, 25 insertions, 28 deletions
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index f99ca37289..daf7a9d277 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -671,48 +671,45 @@ _eo_base_event_callback_call(Eo *obj_id, Eo_Base_Data *pd,
671 671
672 pd->walking_list++; 672 pd->walking_list++;
673 673
674 if (!desc->unfreezable && (event_freeze_count || pd->event_freeze_count))
675 goto end;
676
674 for (cb = pd->callbacks; cb; cb = cb->next) 677 for (cb = pd->callbacks; cb; cb = cb->next)
675 { 678 {
676 if (!cb->delete_me) 679 if (cb->delete_me)
680 continue;
681
682 if (cb->func_array)
677 { 683 {
678 if (cb->func_array) 684 const Eo_Callback_Array_Item *it;
679 {
680 const Eo_Callback_Array_Item *it;
681 685
682 for (it = cb->items.item_array; it->func; it++) 686 for (it = cb->items.item_array; it->func; it++)
683 {
684 if (!_cb_desc_match(it->desc, desc))
685 continue;
686 if (!it->desc->unfreezable &&
687 (event_freeze_count || pd->event_freeze_count))
688 continue;
689
690 /* Abort callback calling if the func says so. */
691 if (!it->func((void *) cb->func_data, obj_id, desc,
692 (void *) event_info))
693 {
694 ret = EINA_FALSE;
695 goto end;
696 }
697 }
698 }
699 else
700 { 687 {
701 if (!_cb_desc_match(cb->items.item.desc, desc)) 688 if (!_cb_desc_match(it->desc, desc))
702 continue;
703 if (!cb->items.item.desc->unfreezable &&
704 (event_freeze_count || pd->event_freeze_count))
705 continue; 689 continue;
706 690
707 /* Abort callback calling if the func says so. */ 691 /* Abort callback calling if the func says so. */
708 if (!cb->items.item.func((void *) cb->func_data, obj_id, desc, 692 if (!it->func((void *) cb->func_data, obj_id, desc,
709 (void *) event_info)) 693 (void *) event_info))
710 { 694 {
711 ret = EINA_FALSE; 695 ret = EINA_FALSE;
712 goto end; 696 goto end;
713 } 697 }
714 } 698 }
715 } 699 }
700 else
701 {
702 if (!_cb_desc_match(cb->items.item.desc, desc))
703 continue;
704
705 /* Abort callback calling if the func says so. */
706 if (!cb->items.item.func((void *) cb->func_data, obj_id, desc,
707 (void *) event_info))
708 {
709 ret = EINA_FALSE;
710 goto end;
711 }
712 }
716 } 713 }
717 714
718end: 715end: